X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fimage%2Fsrc%2FTests%2FImageFieldTestBase.php;h=a1611cb3522df5732de4031722cf2e846b6eac44;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=c023917e363c7b240ca8f4cd815b3f728e99e0b0;hpb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;p=yaffs-website diff --git a/web/core/modules/image/src/Tests/ImageFieldTestBase.php b/web/core/modules/image/src/Tests/ImageFieldTestBase.php index c023917e3..a1611cb35 100644 --- a/web/core/modules/image/src/Tests/ImageFieldTestBase.php +++ b/web/core/modules/image/src/Tests/ImageFieldTestBase.php @@ -2,17 +2,20 @@ namespace Drupal\image\Tests; +@trigger_error('The ' . __NAMESPACE__ . '\ImageFieldTestBase class is deprecated in Drupal 8.5.x and will be removed before Drupal 9.0.0. Use \Drupal\Tests\image\Functional\ImageFieldTestBase instead. See https://www.drupal.org/node/2863626.', E_USER_DEPRECATED); + use Drupal\Tests\image\Kernel\ImageFieldCreationTrait; use Drupal\simpletest\WebTestBase; /** * TODO: Test the following functions. * - * image.effects.inc: + * In file: + * - image.effects.inc: * image_style_generate() * \Drupal\image\ImageStyleInterface::createDerivative() * - * image.module: + * - image.module: * image_style_options() * \Drupal\image\ImageStyleInterface::flush() * image_filter_keyword() @@ -69,7 +72,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 +92,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.