Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / image / src / Tests / ImageFieldTestBase.php
index c023917e363c7b240ca8f4cd815b3f728e99e0b0..0623b6e92f6c0db039bf335cf99c0807cacc6088 100644 (file)
@@ -69,7 +69,7 @@ abstract class ImageFieldTestBase extends WebTestBase {
     $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'));
   }
 
@@ -89,7 +89,7 @@ abstract class ImageFieldTestBase extends WebTestBase {
     $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'));
     if ($alt) {
       // Add alt text.