diff --git a/core/modules/image/src/Tests/ImageAdminStylesTest.php b/core/modules/image/src/Tests/ImageAdminStylesTest.php index ed3854fcba90488a331986f93d67ecc2fd5e05fe..08f0adf9abf744270c45a9c474206ebcf1cb59b5 100644 --- a/core/modules/image/src/Tests/ImageAdminStylesTest.php +++ b/core/modules/image/src/Tests/ImageAdminStylesTest.php @@ -282,7 +282,7 @@ function testStyleReplacement() { // Create a new style. $style_name = strtolower($this->randomMachineName(10)); $style_label = $this->randomString(); - $style = entity_create('image_style', array('name' => $style_name, 'label' => $style_label)); + $style = ImageStyle::create(array('name' => $style_name, 'label' => $style_label)); $style->save(); $style_path = 'admin/config/media/image-styles/manage/'; @@ -387,7 +387,7 @@ public function testFlushUserInterface() { // Create a new style. $style_name = strtolower($this->randomMachineName(10)); - $style = entity_create('image_style', array('name' => $style_name, 'label' => $this->randomString())); + $style = ImageStyle::create(array('name' => $style_name, 'label' => $this->randomString())); $style->save(); // Create an image to make sure it gets flushed. @@ -417,7 +417,7 @@ function testConfigImport() { // Create a new style. $style_name = strtolower($this->randomMachineName(10)); $style_label = $this->randomString(); - $style = entity_create('image_style', array('name' => $style_name, 'label' => $style_label)); + $style = ImageStyle::create(array('name' => $style_name, 'label' => $style_label)); $style->save(); // Create an image field that uses the new style. @@ -458,7 +458,7 @@ function testConfigImport() { * Tests access for the image style listing. */ public function testImageStyleAccess() { - $style = entity_create('image_style', array('name' => 'style_foo', 'label' => $this->randomString())); + $style = ImageStyle::create(array('name' => 'style_foo', 'label' => $this->randomString())); $style->save(); $this->drupalGet('admin/config/media/image-styles'); diff --git a/core/modules/image/src/Tests/ImageDimensionsTest.php b/core/modules/image/src/Tests/ImageDimensionsTest.php index c7a738dcad5bfddb4ef97720242f1d40d411c462..09f34a37e3970c823b8645ff80bb1cfd57ddadaa 100644 --- a/core/modules/image/src/Tests/ImageDimensionsTest.php +++ b/core/modules/image/src/Tests/ImageDimensionsTest.php @@ -38,7 +38,7 @@ function testImageDimensions() { // Create a style. /** @var $style \Drupal\image\ImageStyleInterface */ - $style = entity_create('image_style', array('name' => 'test', 'label' => 'Test')); + $style = ImageStyle::create(array('name' => 'test', 'label' => 'Test')); $style->save(); $generated_uri = 'public://styles/test/public/'. \Drupal::service('file_system')->basename($original_uri); $url = $style->buildUrl($original_uri); diff --git a/core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php b/core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php index 81c16285d7dba00e0dabd9c7dbdabd1f5cd31ef4..28febab9c526126b59594d5b943f9da728964127 100644 --- a/core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php +++ b/core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php @@ -7,6 +7,7 @@ namespace Drupal\image\Tests; +use Drupal\image\Entity\ImageStyle; use Drupal\simpletest\WebTestBase; /** @@ -31,7 +32,7 @@ class ImageStylesPathAndUrlTest extends WebTestBase { protected function setUp() { parent::setUp(); - $this->style = entity_create('image_style', array('name' => 'style_foo', 'label' => $this->randomString())); + $this->style = ImageStyle::create(array('name' => 'style_foo', 'label' => $this->randomString())); $this->style->save(); } diff --git a/core/modules/image/src/Tests/ImageThemeFunctionTest.php b/core/modules/image/src/Tests/ImageThemeFunctionTest.php index 54b471b78e39e1c2e5afaea25a124ce3b7a59ba3..060a8afb26c298fb8a6eb848bdf4d25da405440b 100644 --- a/core/modules/image/src/Tests/ImageThemeFunctionTest.php +++ b/core/modules/image/src/Tests/ImageThemeFunctionTest.php @@ -9,6 +9,7 @@ use Drupal\Core\Field\FieldStorageDefinitionInterface; use Drupal\Core\Url; +use Drupal\image\Entity\ImageStyle; use Drupal\simpletest\WebTestBase; /** @@ -72,7 +73,7 @@ function testImageFormatterTheme() { $original_uri = file_unmanaged_copy($file->uri, 'public://', FILE_EXISTS_RENAME); // Create a style. - $style = entity_create('image_style', array('name' => 'test', 'label' => 'Test')); + $style = ImageStyle::create(array('name' => 'test', 'label' => 'Test')); $style->save(); $url = $style->buildUrl($original_uri); @@ -134,7 +135,7 @@ function testImageStyleTheme() { $original_uri = file_unmanaged_copy($file->uri, 'public://', FILE_EXISTS_RENAME); // Create a style. - $style = entity_create('image_style', array('name' => 'image_test', 'label' => 'Test')); + $style = ImageStyle::create(array('name' => 'image_test', 'label' => 'Test')); $style->save(); $url = $style->buildUrl($original_uri);