diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentAnonymousTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentAnonymousTest.php index f71619b..580ee56 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentAnonymousTest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentAnonymousTest.php @@ -69,7 +69,7 @@ function testAnonymous() { $edit = array( 'name' => $this->admin_user->getUsername(), 'mail' => $this->randomName() . '@example.com', - 'subject' => $this->randomName(), + 'subject[0][value]' => $this->randomName(), 'comment_body[0][value]' => $this->randomName(), ); $this->drupalPostForm('comment/reply/node/' . $this->node->id() . '/comment', $edit, t('Save')); @@ -137,7 +137,7 @@ function testAnonymous() { // Attempt to view node-comment form while disallowed. $this->drupalGet('comment/reply/node/' . $this->node->id() . '/comment'); $this->assertText('You are not authorized to post comments', 'Error attempting to post comment.'); - $this->assertNoFieldByName('subject', '', 'Subject field not found.'); + $this->assertNoFieldByName('subject[0][value]', '', 'Subject field not found.'); $this->assertNoFieldByName('comment_body[0][value]', '', 'Comment field not found.'); user_role_change_permissions(DRUPAL_ANONYMOUS_RID, array( @@ -157,7 +157,7 @@ function testAnonymous() { )); $this->drupalGet('node/' . $this->node->id()); $this->assertNoPattern('@]*>Comments@', 'Comments were not displayed.'); - $this->assertFieldByName('subject', '', 'Subject field found.'); + $this->assertFieldByName('subject[0][value]', '', 'Subject field found.'); $this->assertFieldByName('comment_body[0][value]', '', 'Comment field found.'); $this->drupalGet('comment/reply/node/' . $this->node->id() . '/comment/' . $anonymous_comment3->id()); diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentLanguageTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentLanguageTest.php index 139bf73..b7eddb4 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentLanguageTest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentLanguageTest.php @@ -109,7 +109,7 @@ function testCommentLanguage() { $prefix = empty($prefixes[$langcode]) ? '' : $prefixes[$langcode] . '/'; $comment_values[$node_langcode][$langcode] = $this->randomName(); $edit = array( - 'subject' => $this->randomName(), + 'subject[0][value]' => $this->randomName(), 'comment_body[0][value]' => $comment_values[$node_langcode][$langcode], ); $this->drupalPostForm($prefix . 'node/' . $node->id(), $edit, t('Preview')); diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentNonNodeTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentNonNodeTest.php index d4af65e..5b67a28 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentNonNodeTest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentNonNodeTest.php @@ -98,10 +98,10 @@ function postComment(EntityInterface $entity, $comment, $subject = '', $contact } if ($subject_mode == TRUE) { - $edit['subject'] = $subject; + $edit['subject[0][value]'] = $subject; } else { - $this->assertNoFieldByName('subject', '', 'Subject field not found.'); + $this->assertNoFieldByName('subject[0][value]', '', 'Subject field not found.'); } if ($contact !== NULL && is_array($contact)) { @@ -297,7 +297,7 @@ function testCommentFunctionality() { // Attempt to view test entity comment form while disallowed. $this->drupalGet('comment/reply/entity_test/' . $this->entity->id() . '/comment'); $this->assertText('You are not authorized to post comments', 'Error attempting to post comment.'); - $this->assertNoFieldByName('subject', '', 'Subject field not found.'); + $this->assertNoFieldByName('subject[0][value]', '', 'Subject field not found.'); $this->assertNoFieldByName('comment_body[0][value]', '', 'Comment field not found.'); user_role_change_permissions(DRUPAL_ANONYMOUS_RID, array( @@ -310,7 +310,7 @@ function testCommentFunctionality() { $this->assertPattern('@]*>Comments@', 'Comments were displayed.'); $this->assertLink('Log in', 0, 'Link to log in was found.'); $this->assertLink('register', 0, 'Link to register was found.'); - $this->assertNoFieldByName('subject', '', 'Subject field not found.'); + $this->assertNoFieldByName('subject[0][value]', '', 'Subject field not found.'); $this->assertNoFieldByName('comment_body[0][value]', '', 'Comment field not found.'); // Test the combination of anonymous users being able to post, but not view @@ -324,7 +324,7 @@ function testCommentFunctionality() { )); $this->drupalGet('entity_test/' . $this->entity->id()); $this->assertNoPattern('@]*>Comments@', 'Comments were not displayed.'); - $this->assertFieldByName('subject', '', 'Subject field found.'); + $this->assertFieldByName('subject[0][value]', '', 'Subject field found.'); $this->assertFieldByName('comment_body[0][value]', '', 'Comment field found.'); $this->drupalGet('comment/reply/entity_test/' . $this->entity->id() . '/comment/' . $comment1->id()); @@ -373,7 +373,7 @@ function testCommentFunctionality() { $this->assertNoField('edit-field-foobar-0-status-0'); $this->drupalGet('comment/reply/entity_test/comment/' . $new_entity->id()); - $this->assertNoFieldByName('subject', '', 'Subject field found.'); + $this->assertNoFieldByName('subject[0][value]', '', 'Subject field found.'); $this->assertNoFieldByName('comment_body[0][value]', '', 'Comment field found.'); } diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php index 1de62da..fbd29b5 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php @@ -54,17 +54,17 @@ function testCommentPreview() { // As the web user, fill in the comment form and preview the comment. $edit = array(); - $edit['subject'] = $this->randomName(8); + $edit['subject[0][value]'] = $this->randomName(8); $edit['comment_body[0][value]'] = $this->randomName(16); $this->drupalPostForm('node/' . $this->node->id(), $edit, t('Preview')); // Check that the preview is displaying the title and body. $this->assertTitle(t('Preview comment | Drupal'), 'Page title is "Preview comment".'); - $this->assertText($edit['subject'], 'Subject displayed.'); + $this->assertText($edit['subject[0][value]'], 'Subject displayed.'); $this->assertText($edit['comment_body[0][value]'], 'Comment displayed.'); // Check that the title and body fields are displayed with the correct values. - $this->assertFieldByName('subject', $edit['subject'], 'Subject field displayed.'); + $this->assertFieldByName('subject[0][value]', $edit['subject[0][value]'], 'Subject field displayed.'); $this->assertFieldByName('comment_body[0][value]', $edit['comment_body[0][value]'], 'Comment field displayed.'); // Check that the signature is displaying with the correct text format. @@ -87,7 +87,7 @@ function testCommentEditPreviewSave() { $edit = array(); $date = new DrupalDateTime('2008-03-02 17:23'); - $edit['subject'] = $this->randomName(8); + $edit['subject[0][value]'] = $this->randomName(8); $edit['comment_body[0][value]'] = $this->randomName(16); $edit['name'] = $web_user->getUsername(); $edit['date[date]'] = $date->format('Y-m-d'); @@ -96,18 +96,18 @@ function testCommentEditPreviewSave() { $expected_text_date = format_date($raw_date); $expected_form_date = $date->format('Y-m-d'); $expected_form_time = $date->format('H:i:s'); - $comment = $this->postComment($this->node, $edit['subject'], $edit['comment_body[0][value]'], TRUE); + $comment = $this->postComment($this->node, $edit['subject[0][value]'], $edit['comment_body[0][value]'], TRUE); $this->drupalPostForm('comment/' . $comment->id() . '/edit', $edit, t('Preview')); // Check that the preview is displaying the subject, comment, author and date correctly. $this->assertTitle(t('Preview comment | Drupal'), 'Page title is "Preview comment".'); - $this->assertText($edit['subject'], 'Subject displayed.'); + $this->assertText($edit['subject[0][value]'], 'Subject displayed.'); $this->assertText($edit['comment_body[0][value]'], 'Comment displayed.'); $this->assertText($edit['name'], 'Author displayed.'); $this->assertText($expected_text_date, 'Date displayed.'); // Check that the subject, comment, author and date fields are displayed with the correct values. - $this->assertFieldByName('subject', $edit['subject'], 'Subject field displayed.'); + $this->assertFieldByName('subject[0][value]', $edit['subject[0][value]'], 'Subject field displayed.'); $this->assertFieldByName('comment_body[0][value]', $edit['comment_body[0][value]'], 'Comment field displayed.'); $this->assertFieldByName('name', $edit['name'], 'Author field displayed.'); $this->assertFieldByName('date[date]', $edit['date[date]'], 'Date field displayed.'); @@ -119,7 +119,7 @@ function testCommentEditPreviewSave() { // Check that the comment fields are correct after loading the saved comment. $this->drupalGet('comment/' . $comment->id() . '/edit'); - $this->assertFieldByName('subject', $edit['subject'], 'Subject field displayed.'); + $this->assertFieldByName('subject[0][value]', $edit['subject[0][value]'], 'Subject field displayed.'); $this->assertFieldByName('comment_body[0][value]', $edit['comment_body[0][value]'], 'Comment field displayed.'); $this->assertFieldByName('name', $edit['name'], 'Author field displayed.'); $this->assertFieldByName('date[date]', $expected_form_date, 'Date field displayed.'); @@ -127,7 +127,7 @@ function testCommentEditPreviewSave() { // Submit the form using the displayed values. $displayed = array(); - $displayed['subject'] = (string) current($this->xpath("//input[@id='edit-subject']/@value")); + $displayed['subject[0][value]'] = (string) current($this->xpath("//input[@id='edit-subject-0-value']/@value")); $displayed['comment_body[0][value]'] = (string) current($this->xpath("//textarea[@id='edit-comment-body-0-value']")); $displayed['name'] = (string) current($this->xpath("//input[@id='edit-name']/@value")); $displayed['date[date]'] = (string) current($this->xpath("//input[@id='edit-date-date']/@value")); @@ -136,7 +136,7 @@ function testCommentEditPreviewSave() { // Check that the saved comment is still correct. $comment_loaded = comment_load($comment->id(), TRUE); - $this->assertEqual($comment_loaded->getSubject(), $edit['subject'], 'Subject loaded.'); + $this->assertEqual($comment_loaded->getSubject(), $edit['subject[0][value]'], 'Subject loaded.'); $this->assertEqual($comment_loaded->comment_body->value, $edit['comment_body[0][value]'], 'Comment body loaded.'); $this->assertEqual($comment_loaded->getAuthorName(), $edit['name'], 'Name loaded.'); $this->assertEqual($comment_loaded->getCreatedTime(), $raw_date, 'Date loaded.'); diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php index c1edf13..3edad1d 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php @@ -119,10 +119,10 @@ public function postComment($entity, $comment, $subject = '', $contact = NULL, $ } if ($subject_mode == TRUE) { - $edit['subject'] = $subject; + $edit['subject[0][value]'] = $subject; } else { - $this->assertNoFieldByName('subject', '', 'Subject field not found.'); + $this->assertNoFieldByName('subject[0][value]', '', 'Subject field not found.'); } if ($contact !== NULL && is_array($contact)) { diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentTranslationUITest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentTranslationUITest.php index 5e5b4de..b971a6f 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentTranslationUITest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentTranslationUITest.php @@ -119,7 +119,7 @@ protected function createEntity($values, $langcode, $node_bundle = 'node__commen protected function getNewEntityValues($langcode) { // Comment subject is not translatable hence we use a fixed value. return array( - 'subject' => $this->subject, + 'subject' => array(array('value' => $this->subject)), 'comment_body' => array(array('value' => $this->randomName(16))), ) + parent::getNewEntityValues($langcode); } diff --git a/core/modules/config_translation/lib/Drupal/config_translation/Tests/ConfigTranslationUiTest.php b/core/modules/config_translation/lib/Drupal/config_translation/Tests/ConfigTranslationUiTest.php index 405aaf5..9aa1a1c 100644 --- a/core/modules/config_translation/lib/Drupal/config_translation/Tests/ConfigTranslationUiTest.php +++ b/core/modules/config_translation/lib/Drupal/config_translation/Tests/ConfigTranslationUiTest.php @@ -299,7 +299,7 @@ public function testContactConfigEntityTranslation() { // Submit feedback. $edit = array( - 'subject' => 'Test subject', + 'subject[0][value]' => 'Test subject', 'message' => 'Test message', ); $this->drupalPostForm(NULL, $edit, t('Send message')); diff --git a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php index 6373929..09f8d29 100644 --- a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php +++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php @@ -455,7 +455,7 @@ function testForumWithNewPost() { $this->drupalLogin($this->post_comment_user); // Post a reply to the topic. $edit = array(); - $edit['subject'] = $this->randomName(); + $edit['subject[0][value]'] = $this->randomName(); $edit['comment_body[0][value]'] = $this->randomName(); $this->drupalPostForm('node/' . $node->id(), $edit, t('Save')); $this->assertResponse(200); diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/TrackerAttributesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/TrackerAttributesTest.php index fa7f673..c6d52c1 100644 --- a/core/modules/rdf/lib/Drupal/rdf/Tests/TrackerAttributesTest.php +++ b/core/modules/rdf/lib/Drupal/rdf/Tests/TrackerAttributesTest.php @@ -168,7 +168,7 @@ function _testBasicTrackerRdfaMarkup(NodeInterface $node) { // Adds new comment to ensure the tracker is updated accordingly. $comment = array( - 'subject' => $this->randomName(), + 'subject[0][value]' => $this->randomName(), 'comment_body[0][value]' => $this->randomName(), ); $this->drupalPostForm('comment/reply/node/' . $node->id() .'/comment', $comment, t('Save')); diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchRankingTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchRankingTest.php index 5d16f80..895c0f0 100644 --- a/core/modules/search/lib/Drupal/search/Tests/SearchRankingTest.php +++ b/core/modules/search/lib/Drupal/search/Tests/SearchRankingTest.php @@ -87,7 +87,7 @@ public function testRankings() { // Add a comment to one of the nodes. $edit = array(); - $edit['subject'] = 'my comment title'; + $edit['subject[0][value]'] = 'my comment title'; $edit['comment_body[0][value]'] = 'some random comment'; $this->drupalGet('comment/reply/node/' . $nodes['comments'][1]->id() . '/comment'); $this->drupalPostForm(NULL, $edit, t('Preview')); diff --git a/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php b/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php index 001de20..560d530 100644 --- a/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php +++ b/core/modules/tracker/lib/Drupal/tracker/Tests/TrackerTest.php @@ -108,7 +108,7 @@ function testTrackerUser() { 'status' => 1, )); $comment = array( - 'subject' => $this->randomName(), + 'subject[0][value]' => $this->randomName(), 'comment_body[0][value]' => $this->randomName(20), ); $this->drupalPostForm('comment/reply/node/' . $other_published_my_comment->id() . '/comment', $comment, t('Save')); @@ -186,7 +186,7 @@ function testTrackerNewComments() { // Add a comment to the page. $comment = array( - 'subject' => $this->randomName(), + 'subject[0][value]' => $this->randomName(), 'comment_body[0][value]' => $this->randomName(20), ); $this->drupalPostForm('comment/reply/node/' . $node->id() . '/comment', $comment, t('Save')); @@ -207,7 +207,7 @@ function testTrackerNewComments() { // Add another comment as other_user. $comment = array( - 'subject' => $this->randomName(), + 'subject[0][value]' => $this->randomName(), 'comment_body[0][value]' => $this->randomName(20), ); // If the comment is posted in the same second as the last one then Drupal @@ -239,7 +239,7 @@ function testTrackerCronIndexing() { // Add a comment to the last node as other user. $this->drupalLogin($this->other_user); $comment = array( - 'subject' => $this->randomName(), + 'subject[0][value]' => $this->randomName(), 'comment_body[0][value]' => $this->randomName(20), ); $this->drupalPostForm('comment/reply/node/' . $nodes[3]->id() . '/comment', $comment, t('Save')); diff --git a/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php b/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php index edd4ea1..12dcb86 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php @@ -319,13 +319,13 @@ function testUserDelete() { // Create comment. $edit = array(); - $edit['subject'] = $this->randomName(8); + $edit['subject[0][value]'] = $this->randomName(8); $edit['comment_body[0][value]'] = $this->randomName(16); $this->drupalPostForm('comment/reply/node/' . $node->id() . '/comment', $edit, t('Preview')); $this->drupalPostForm(NULL, array(), t('Save')); $this->assertText(t('Your comment has been posted.')); - $comments = entity_load_multiple_by_properties('comment', array('subject' => $edit['subject'])); + $comments = entity_load_multiple_by_properties('comment', array('subject' => $edit['subject[0][value]'])); $comment = reset($comments); $this->assertTrue($comment->id(), 'Comment found.'); diff --git a/core/modules/user/lib/Drupal/user/Tests/UserSignatureTest.php b/core/modules/user/lib/Drupal/user/Tests/UserSignatureTest.php index 74a1712..7bf405f 100644 --- a/core/modules/user/lib/Drupal/user/Tests/UserSignatureTest.php +++ b/core/modules/user/lib/Drupal/user/Tests/UserSignatureTest.php @@ -102,7 +102,7 @@ function testUserSignature() { // Create a comment. $edit = array(); - $edit['subject'] = $this->randomName(8); + $edit['subject[0][value]'] = $this->randomName(8); $edit['comment_body[0][value]'] = $this->randomName(16); $this->drupalPostForm('comment/reply/node/' . $node->id() .'/comment', $edit, t('Preview')); $this->drupalPostForm(NULL, array(), t('Save'));