X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fcore%2Fmodules%2Ffile%2Fsrc%2FTests%2FFileFieldWidgetTest.php;fp=web%2Fcore%2Fmodules%2Ffile%2Fsrc%2FTests%2FFileFieldWidgetTest.php;h=8017ebf1b25dd88fef5bc93f19700778184de76b;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hp=ad47d77841713d94e62ef7e00eb0bbd31d34c4a1;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0;p=yaffs-website diff --git a/web/core/modules/file/src/Tests/FileFieldWidgetTest.php b/web/core/modules/file/src/Tests/FileFieldWidgetTest.php index ad47d7784..8017ebf1b 100644 --- a/web/core/modules/file/src/Tests/FileFieldWidgetTest.php +++ b/web/core/modules/file/src/Tests/FileFieldWidgetTest.php @@ -160,7 +160,7 @@ class FileFieldWidgetTest extends FileFieldTestBase { $this->drupalGet("node/add/$type_name"); foreach ([$field_name2, $field_name] as $each_field_name) { for ($delta = 0; $delta < 3; $delta++) { - $edit = ['files[' . $each_field_name . '_' . $delta . '][]' => drupal_realpath($test_file->getFileUri())]; + $edit = ['files[' . $each_field_name . '_' . $delta . '][]' => \Drupal::service('file_system')->realpath($test_file->getFileUri())]; // If the Upload button doesn't exist, drupalPostForm() will automatically // fail with an assertion message. $this->drupalPostForm(NULL, $edit, t('Upload')); @@ -373,7 +373,7 @@ class FileFieldWidgetTest extends FileFieldTestBase { // Add a comment with a file. $text_file = $this->getTestFile('text'); $edit = [ - 'files[field_' . $name . '_' . 0 . ']' => drupal_realpath($text_file->getFileUri()), + 'files[field_' . $name . '_' . 0 . ']' => \Drupal::service('file_system')->realpath($text_file->getFileUri()), 'comment_body[0][value]' => $comment_body = $this->randomMachineName(), ]; $this->drupalPostForm('node/' . $node->id(), $edit, t('Save')); @@ -429,7 +429,7 @@ class FileFieldWidgetTest extends FileFieldTestBase { $name = 'files[' . $field_name . '_0]'; // Upload file with incorrect extension, check for validation error. - $edit[$name] = drupal_realpath($test_file_image->getFileUri()); + $edit[$name] = \Drupal::service('file_system')->realpath($test_file_image->getFileUri()); switch ($type) { case 'nojs': $this->drupalPostForm(NULL, $edit, t('Upload')); @@ -443,7 +443,7 @@ class FileFieldWidgetTest extends FileFieldTestBase { $this->assertRaw($error_message, t('Validation error when file with wrong extension uploaded (JSMode=%type).', ['%type' => $type])); // Upload file with correct extension, check that error message is removed. - $edit[$name] = drupal_realpath($test_file_text->getFileUri()); + $edit[$name] = \Drupal::service('file_system')->realpath($test_file_text->getFileUri()); switch ($type) { case 'nojs': $this->drupalPostForm(NULL, $edit, t('Upload'));