X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Ffile%2Fsrc%2FTests%2FFileFieldTestBase.php;h=0f82af3eac67322d8c935f8801bb7dfbd650187d;hb=5b8bb166bfa98770daef9de5c127fc2e6ef02340;hp=73cc96ad504d9333bf9eb5bc772dbd1d2d4ddf28;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/core/modules/file/src/Tests/FileFieldTestBase.php b/web/core/modules/file/src/Tests/FileFieldTestBase.php index 73cc96ad5..0f82af3ea 100644 --- a/web/core/modules/file/src/Tests/FileFieldTestBase.php +++ b/web/core/modules/file/src/Tests/FileFieldTestBase.php @@ -2,6 +2,8 @@ namespace Drupal\file\Tests; +@trigger_error('The ' . __NAMESPACE__ . '\FileFieldTestBase is deprecated in Drupal 8.5.x and will be removed before Drupal 9.0.0. Instead, use \Drupal\Tests\file\Functional\FileFieldTestBase. See https://www.drupal.org/node/2969361.', E_USER_DEPRECATED); + use Drupal\field\Entity\FieldStorageConfig; use Drupal\field\Entity\FieldConfig; use Drupal\file\FileInterface; @@ -227,7 +229,7 @@ abstract class FileFieldTestBase extends WebTestBase { $edit[$name][] = $file_path; } } - $this->drupalPostForm("node/$nid/edit", $edit, t('Save and keep published')); + $this->drupalPostForm("node/$nid/edit", $edit, t('Save')); return $nid; } @@ -243,7 +245,7 @@ abstract class FileFieldTestBase extends WebTestBase { ]; $this->drupalPostForm('node/' . $nid . '/edit', [], t('Remove')); - $this->drupalPostForm(NULL, $edit, t('Save and keep published')); + $this->drupalPostForm(NULL, $edit, t('Save')); } /** @@ -251,12 +253,12 @@ abstract class FileFieldTestBase extends WebTestBase { */ public function replaceNodeFile($file, $field_name, $nid, $new_revision = TRUE) { $edit = [ - 'files[' . $field_name . '_0]' => drupal_realpath($file->getFileUri()), + 'files[' . $field_name . '_0]' => \Drupal::service('file_system')->realpath($file->getFileUri()), 'revision' => (string) (int) $new_revision, ]; $this->drupalPostForm('node/' . $nid . '/edit', [], t('Remove')); - $this->drupalPostForm(NULL, $edit, t('Save and keep published')); + $this->drupalPostForm(NULL, $edit, t('Save')); } /**