41bb46c (HEAD, 2226493) first test fixes diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentLanguageTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentLanguageTest.php index 56444a9..e6f963c 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentLanguageTest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentLanguageTest.php @@ -97,7 +97,7 @@ function testCommentLanguage() { $edit = array( 'title[0][value]' => $title, 'body[0][value]' => $this->randomName(), - 'langcode' => $node_langcode, + 'langcode[0][value]' => $node_langcode, 'comment[0][status]' => CommentItemInterface::OPEN, ); $this->drupalPostForm("node/add/article", $edit, t('Save')); diff --git a/core/modules/forum/lib/Drupal/forum/Tests/ForumBlockTest.php b/core/modules/forum/lib/Drupal/forum/Tests/ForumBlockTest.php index 3799288..a1fbfe3 100644 --- a/core/modules/forum/lib/Drupal/forum/Tests/ForumBlockTest.php +++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumBlockTest.php @@ -174,8 +174,8 @@ protected function createForumTopics($count = 5) { 'body[0][value]' => $body, // Forum posts are ordered by timestamp, so force a unique timestamp by // adding the index. - 'created[date]' => $date->format('Y-m-d'), - 'created[time]' => $date->format('H:i:s'), + 'created[0][value][date]' => $date->format('Y-m-d'), + 'created[0][value][time]' => $date->format('H:i:s'), ); // Create the forum topic, preselecting the forum ID via a URL parameter. diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php index 093da50..5260b5d 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleContentTest.php @@ -104,7 +104,7 @@ function testContentTypeLanguageConfiguration() { // Verify language selection appears on the node add form. $this->drupalGet("node/add/{$type2->type}"); // Verify language select list is present. - $this->assertFieldByName('langcode', NULL, 'Language select present on the node add form.'); + $this->assertFieldByName('langcode[0][value]', NULL, 'Language select present on the node add form.'); // Ensure language appears. $this->assertText($name, 'Language present.'); @@ -115,7 +115,7 @@ function testContentTypeLanguageConfiguration() { 'type' => $type2->type, 'title' => $node_title, 'body' => array(array('value' => $node_body)), - 'langcode' => $langcode, + 'langcode[0][value]' => $langcode, ); $node = $this->drupalCreateNode($edit); // Edit the content and ensure correct language is selected. @@ -124,7 +124,7 @@ function testContentTypeLanguageConfiguration() { $this->assertRaw('', 'Correct language selected.'); // Ensure we can change the node language. $edit = array( - 'langcode' => 'en', + 'langcode[0][value]' => 'en', ); $this->drupalPostForm($path, $edit, t('Save')); $this->assertRaw(t('%title has been updated.', array('%title' => $node_title))); diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php index c5b4514..52867e8 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeCreationTest.php @@ -149,7 +149,7 @@ public function testAuthorAutocomplete() { $this->drupalGet('node/add/page'); - $result = $this->xpath('//input[@id="edit-uid" and contains(@data-autocomplete-path, "user/autocomplete")]'); + $result = $this->xpath('//input[@id="edit-uid-0-value" and contains(@data-autocomplete-path, "user/autocomplete")]'); $this->assertEqual(count($result), 0, 'No autocompletion without access user profiles.'); $admin_user = $this->drupalCreateUser(array('administer nodes', 'create page content', 'access user profiles')); @@ -157,7 +157,7 @@ public function testAuthorAutocomplete() { $this->drupalGet('node/add/page'); - $result = $this->xpath('//input[@id="edit-uid" and contains(@data-autocomplete-path, "user/autocomplete")]'); + $result = $this->xpath('//input[@id="edit-uid-0-value" and contains(@data-autocomplete-path, "user/autocomplete")]'); $this->assertEqual(count($result), 1, 'Ensure that the user does have access to the autocompletion'); } diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php b/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php index 7ed9f14..c1c86af 100644 --- a/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php +++ b/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php @@ -88,7 +88,7 @@ protected function createEntity($values, $langcode, $bundle_name = NULL) { $edit = array( 'title[0][value]' => $values['title'][0]['value'], "{$this->fieldName}[0][value]" => $values[$this->fieldName][0]['value'], - 'langcode' => $langcode, + 'langcode[0][value]' => $langcode, ); $this->drupalPostForm('node/add/article', $edit,t('Save and publish')); $this->drupalLogin($this->translator); @@ -176,7 +176,7 @@ function testTranslateLinkContentAdminPage() { $this->drupalLogin($this->administrator); $page = $this->drupalCreateNode(array('type' => 'page')); - $article = $this->drupalCreateNode(array('type' => 'article', 'langcode' => $this->langcodes[0])); + $article = $this->drupalCreateNode(array('type' => 'article', 'langcode[0][value]' => $this->langcodes[0])); // Verify translation links. $this->drupalGet('admin/content'); @@ -191,7 +191,7 @@ function testTranslateLinkContentAdminPage() { function testFieldTranslationForm() { $this->drupalLogin($this->administrator); - $article = $this->drupalCreateNode(array('type' => 'article', 'langcode' => 'en')); + $article = $this->drupalCreateNode(array('type' => 'article', 'langcode[0][value]' => 'en')); // Visit translation page. $this->drupalGet('node/' . $article->id() . '/translations'); diff --git a/core/modules/node/lib/Drupal/node/Tests/PageEditTest.php b/core/modules/node/lib/Drupal/node/Tests/PageEditTest.php index 2361d13..3f30649 100644 --- a/core/modules/node/lib/Drupal/node/Tests/PageEditTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/PageEditTest.php @@ -114,21 +114,21 @@ function testPageAuthoredBy() { // Try to change the 'authored by' field to an invalid user name. $edit = array( - 'uid' => 'invalid-name', + 'uid[0][value]' => 'invalid-name', ); $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save and keep published')); $this->assertText('The username invalid-name does not exist.'); // Change the authored by field to an empty string, which should assign // authorship to the anonymous user (uid 0). - $edit['uid'] = ''; + $edit['uid[0][value]'] = ''; $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save and keep published')); $node = node_load($node->id(), TRUE); $this->assertIdentical($node->getOwnerId(), '0', 'Node authored by anonymous user.'); // Change the authored by field to another user's name (that is not // logged in). - $edit['uid'] = $this->web_user->getUsername(); + $edit['uid[0][value]'] = $this->web_user->getUsername(); $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save and keep published')); $node = node_load($node->id(), TRUE); $this->assertIdentical($node->getOwnerId(), $this->web_user->id(), 'Node authored by normal user.'); @@ -136,6 +136,6 @@ function testPageAuthoredBy() { // Check that normal users cannot change the authored by information. $this->drupalLogin($this->web_user); $this->drupalGet('node/' . $node->id() . '/edit'); - $this->assertNoFieldByName('uid'); + $this->assertNoFieldByName('uid[0][value]'); } } diff --git a/core/modules/node/lib/Drupal/node/Tests/PagePreviewTest.php b/core/modules/node/lib/Drupal/node/Tests/PagePreviewTest.php index 48a8ea6..4a6cebe 100644 --- a/core/modules/node/lib/Drupal/node/Tests/PagePreviewTest.php +++ b/core/modules/node/lib/Drupal/node/Tests/PagePreviewTest.php @@ -192,7 +192,7 @@ function testPagePreviewWithRevisions() { $edit[$title_key] = $this->randomName(8); $edit[$body_key] = $this->randomName(16); $edit[$term_key] = $this->term->id(); - $edit['log'] = $this->randomName(32); + $edit['log[0][value]'] = $this->randomName(32); $this->drupalPostForm('node/add/page', $edit, t('Preview')); // Check that the preview is displaying the title, body and term. @@ -207,7 +207,7 @@ function testPagePreviewWithRevisions() { $this->assertFieldByName($term_key, $edit[$term_key], 'Term field displayed.'); // Check that the log field has the correct value. - $this->assertFieldByName('log', $edit['log'], 'Log field displayed.'); + $this->assertFieldByName('log[0][value]', $edit['log[0][value]'], 'Log field displayed.'); } } diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/LegacyTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/LegacyTest.php index cddfefd..37a1f53 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/LegacyTest.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/LegacyTest.php @@ -38,8 +38,8 @@ function testTaxonomyLegacyNode() { $date = new DrupalDateTime('1969-01-01 00:00:00'); $edit = array(); $edit['title[0][value]'] = $this->randomName(); - $edit['created[date]'] = $date->format('Y-m-d'); - $edit['created[time]'] = $date->format('H:i:s'); + $edit['created[0][value][date]'] = $date->format($date_format); + $edit['created[0][value][time]'] = $date->format($time_format); $edit['body[0][value]'] = $this->randomName(); $edit['field_tags'] = $this->randomName(); $this->drupalPostForm('node/add/article', $edit, t('Save and publish'));