Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / comment / tests / src / Functional / CommentPreviewTest.php
index 89ac6681de0be5fc0ee02ed4cf3e2d5ce2474e23..91544b636767b3fe6d34c3f6e0271d1c6338da93 100644 (file)
@@ -60,7 +60,7 @@ class CommentPreviewTest extends CommentTestBase {
 
     // Add a user picture.
     $image = current($this->drupalGetTestFiles('image'));
-    $user_edit['files[user_picture_0]'] = drupal_realpath($image->uri);
+    $user_edit['files[user_picture_0]'] = \Drupal::service('file_system')->realpath($image->uri);
     $this->drupalPostForm('user/' . $this->webUser->id() . '/edit', $user_edit, t('Save'));
 
     // As the web user, fill in the comment form and preview the comment.
@@ -117,6 +117,8 @@ class CommentPreviewTest extends CommentTestBase {
 
     // Go back and re-submit the form.
     $this->getSession()->getDriver()->back();
+    $submit_button = $this->assertSession()->buttonExists('Save');
+    $submit_button->click();
     $this->assertText('Your comment has been posted.');
     $elements = $this->xpath('//section[contains(@class, "comment-wrapper")]/article');
     $this->assertEqual(2, count($elements));