Update to Drupal 8.0.6. For more information, see https://www.drupal.org/drupal-8.0.6-release-notes

This commit is contained in:
Pantheon Automation 2016-04-07 11:19:57 -07:00 committed by Greg Anderson
parent 4297c64508
commit b11a755ba8
159 changed files with 2340 additions and 543 deletions

View file

@ -57,6 +57,30 @@ class MigrateNodeTest extends MigrateNodeTestBase {
$this->assertIdentical('test rev 3', $node->body->value);
$this->assertIdentical('filtered_html', $node->body->format);
// Test that link fields are migrated.
$this->assertIdentical('http://groups.drupal.org/', $node->field_test_link->uri);
$this->assertIdentical('Drupal Groups', $node->field_test_link->title);
$this->assertIdentical([], $node->field_test_link->options['attributes']);
// Rerun migration with invalid link attributes and a different URL and
// title. If only the attributes are changed the error does not occur.
Database::getConnection('default', 'migrate')
->update('content_type_story')
->fields([
'field_test_link_url' => 'https://www.drupal.org/node/2127611',
'field_test_link_title' => 'Migrate API in Drupal 8',
'field_test_link_attributes' => '',
])
->condition('nid', '2')
->condition('vid', '3')
->execute();
$this->rerunMigration();
$node = Node::load(2);
$this->assertIdentical('https://www.drupal.org/node/2127611', $node->field_test_link->uri);
$this->assertIdentical('Migrate API in Drupal 8', $node->field_test_link->title);
$this->assertIdentical([], $node->field_test_link->options['attributes']);
// Test that we can re-import using the EntityContentBase destination.
$title = $this->rerunMigration();
$node = Node::load(2);

View file

@ -72,6 +72,24 @@ class NodeQueryAlterTest extends NodeTestBase {
}
}
/**
* Tests 'node_access' query alter with revision-enabled nodes.
*/
public function testNodeQueryAlterWithRevisions() {
// Execute a query that only deals with the 'node_revision' table.
try {
$query = \Drupal::entityTypeManager()->getStorage('node')->getQuery();
$result = $query
->allRevisions()
->execute();
$this->assertEqual(count($result), 4, 'User with access can see correct nodes');
}
catch (\Exception $e) {
$this->fail('Altered query is malformed');
}
}
/**
* Tests 'node_access' query alter, for user without access.
*

View file

@ -14,6 +14,10 @@ use Drupal\simpletest\WebTestBase;
/**
* Ensures that node types translation work correctly.
*
* Note that the child site is installed in French; therefore, when making
* assertions on translated text it is important to provide a langcode. This
* ensures the asserts pass regardless of the Drupal version.
*
* @group node
*/
class NodeTypeTranslationTest extends WebTestBase {
@ -105,12 +109,16 @@ class NodeTypeTranslationTest extends WebTestBase {
// Check the name is translated without admin theme for editing.
$this->drupalPostForm('admin/appearance', array('use_admin_theme' => '0'), t('Save configuration'));
$this->drupalGet("$langcode/node/add/$type");
$this->assertRaw(t('Create @name', array('@name' => $translated_name)));
// This is a Spanish page, so ensure the text asserted is translated in
// Spanish and not French by adding the langcode option.
$this->assertRaw(t('Create @name', array('@name' => $translated_name), array('langcode' => $langcode)));
// Check the name is translated with admin theme for editing.
$this->drupalPostForm('admin/appearance', array('use_admin_theme' => '1'), t('Save configuration'));
$this->drupalGet("$langcode/node/add/$type");
$this->assertRaw(t('Create @name', array('@name' => $translated_name)));
// This is a Spanish page, so ensure the text asserted is translated in
// Spanish and not French by adding the langcode option.
$this->assertRaw(t('Create @name', array('@name' => $translated_name), array('langcode' => $langcode)));
}
/**
@ -128,17 +136,19 @@ class NodeTypeTranslationTest extends WebTestBase {
// Assert that the title label is displayed on the translation form with the right value.
$this->drupalGet("admin/structure/types/manage/$type/translate/$langcode/add");
$this->assertRaw(t('Label'));
$this->assertRaw(t('Edited title'));
$this->assertText('Edited title');
// Translate the title label.
$this->drupalPostForm(NULL, array("translation[config_names][core.base_field_override.node.$type.title][label]" => 'Translated title'), t('Save translation'));
// Assert that the right title label is displayed on the node add form.
// Assert that the right title label is displayed on the node add form. The
// translations are created in this test; therefore, the assertions do not
// use t(). If t() were used then the correct langcodes would need to be
// provided.
$this->drupalGet("node/add/$type");
$this->assertRaw(t('Edited title'));
$this->assertText('Edited title');
$this->drupalGet("$langcode/node/add/$type");
$this->assertRaw(t('Translated title'));
$this->assertText('Translated title');
}
}