Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / image / tests / src / Functional / ImageFieldTestBase.php
index 5fa06140407f93a9d7de16184baf2cfcfdbad996..b9d659a16dbd460c045a388be696d17874b132aa 100644 (file)
@@ -66,7 +66,7 @@ abstract class ImageFieldTestBase extends BrowserTestBase {
     $edit = [
       'title[0][value]' => $this->randomMachineName(),
     ];
-    $edit['files[' . $field_name . '_0]'] = drupal_realpath($image->uri);
+    $edit['files[' . $field_name . '_0]'] = \Drupal::service('file_system')->realpath($image->uri);
     $this->drupalPostForm('node/add/' . $type, $edit, t('Preview'));
   }
 
@@ -86,7 +86,7 @@ abstract class ImageFieldTestBase extends BrowserTestBase {
     $edit = [
       'title[0][value]' => $this->randomMachineName(),
     ];
-    $edit['files[' . $field_name . '_0]'] = drupal_realpath($image->uri);
+    $edit['files[' . $field_name . '_0]'] = \Drupal::service('file_system')->realpath($image->uri);
     $this->drupalPostForm('node/add/' . $type, $edit, t('Save and publish'));
     if ($alt) {
       // Add alt text.