diff core/modules/image/src/Tests/ImageOnTranslatedEntityTest.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 4c8ae668cc8c
children
line wrap: on
line diff
--- a/core/modules/image/src/Tests/ImageOnTranslatedEntityTest.php	Mon Apr 23 09:33:26 2018 +0100
+++ b/core/modules/image/src/Tests/ImageOnTranslatedEntityTest.php	Mon Apr 23 09:46:53 2018 +0100
@@ -95,7 +95,7 @@
     // Edit the node to upload a file.
     $edit = [];
     $name = 'files[' . $this->fieldName . '_0]';
-    $edit[$name] = drupal_realpath($this->drupalGetTestFiles('image')[0]->uri);
+    $edit[$name] = \Drupal::service('file_system')->realpath($this->drupalGetTestFiles('image')[0]->uri);
     $this->drupalPostForm('node/' . $default_language_node->id() . '/edit', $edit, t('Save'));
     $edit = [$this->fieldName . '[0][alt]' => 'Lost in translation image', $this->fieldName . '[0][title]' => 'Lost in translation image title'];
     $this->drupalPostForm(NULL, $edit, t('Save'));
@@ -108,7 +108,7 @@
     $edit = [];
     $edit['title[0][value]'] = 'Scarlett Johansson';
     $name = 'files[' . $this->fieldName . '_0]';
-    $edit[$name] = drupal_realpath($this->drupalGetTestFiles('image')[1]->uri);
+    $edit[$name] = \Drupal::service('file_system')->realpath($this->drupalGetTestFiles('image')[1]->uri);
     $this->drupalPostForm(NULL, $edit, t('Save (this translation)'));
     $edit = [$this->fieldName . '[0][alt]' => 'Scarlett Johansson image', $this->fieldName . '[0][title]' => 'Scarlett Johansson image title'];
     $this->drupalPostForm(NULL, $edit, t('Save (this translation)'));
@@ -140,7 +140,7 @@
     $edit = [];
     $edit['title[0][value]'] = 'Akiko Takeshita';
     $name = 'files[' . $this->fieldName . '_0]';
-    $edit[$name] = drupal_realpath($this->drupalGetTestFiles('image')[2]->uri);
+    $edit[$name] = \Drupal::service('file_system')->realpath($this->drupalGetTestFiles('image')[2]->uri);
     $this->drupalPostForm(NULL, $edit, t('Save (this translation)'));
     $edit = [$this->fieldName . '[0][alt]' => 'Akiko Takeshita image', $this->fieldName . '[0][title]' => 'Akiko Takeshita image title'];
     $this->drupalPostForm(NULL, $edit, t('Save (this translation)'));
@@ -175,7 +175,7 @@
     $edit = [];
     $edit['title[0][value]'] = 'Giovanni Ribisi';
     $name = 'files[' . $this->fieldName . '_0]';
-    $edit[$name] = drupal_realpath($this->drupalGetTestFiles('image')[3]->uri);
+    $edit[$name] = \Drupal::service('file_system')->realpath($this->drupalGetTestFiles('image')[3]->uri);
     $this->drupalPostForm(NULL, $edit, t('Save (this translation)'));
     $name = $this->fieldName . '[0][alt]';