summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathaniel Catchpole2016-01-01 04:17:26 (GMT)
committerNathaniel Catchpole2016-01-01 04:17:26 (GMT)
commit9b2f974fe690b35131d7aaac6a01e3f08049dfc5 (patch)
tree8e0cc953b5724cb4ff978fdf99340699e8e8ec40
parent3220741157d5ed5d7ed5ce1f53728f778af279cb (diff)
Issue #2641590 by ashhishhh, Mac_Weber: Replace deprecated usage of entity_create('image_style') with a direct call to ImageStyle::create()
-rw-r--r--core/modules/image/src/Tests/ImageAdminStylesTest.php8
-rw-r--r--core/modules/image/src/Tests/ImageDimensionsTest.php2
-rw-r--r--core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php3
-rw-r--r--core/modules/image/src/Tests/ImageThemeFunctionTest.php5
4 files changed, 10 insertions, 8 deletions
diff --git a/core/modules/image/src/Tests/ImageAdminStylesTest.php b/core/modules/image/src/Tests/ImageAdminStylesTest.php
index ed3854f..08f0adf 100644
--- a/core/modules/image/src/Tests/ImageAdminStylesTest.php
+++ b/core/modules/image/src/Tests/ImageAdminStylesTest.php
@@ -282,7 +282,7 @@ class ImageAdminStylesTest extends ImageFieldTestBase {
// 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 @@ class ImageAdminStylesTest extends ImageFieldTestBase {
// 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 @@ class ImageAdminStylesTest extends ImageFieldTestBase {
// 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 @@ class ImageAdminStylesTest extends ImageFieldTestBase {
* 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 c7a738d..09f34a3 100644
--- a/core/modules/image/src/Tests/ImageDimensionsTest.php
+++ b/core/modules/image/src/Tests/ImageDimensionsTest.php
@@ -38,7 +38,7 @@ class ImageDimensionsTest extends WebTestBase {
// 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 81c1628..28febab 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 54b471b..060a8af 100644
--- a/core/modules/image/src/Tests/ImageThemeFunctionTest.php
+++ b/core/modules/image/src/Tests/ImageThemeFunctionTest.php
@@ -9,6 +9,7 @@ namespace Drupal\image\Tests;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\Core\Url;
+use Drupal\image\Entity\ImageStyle;
use Drupal\simpletest\WebTestBase;
/**
@@ -72,7 +73,7 @@ class ImageThemeFunctionTest extends WebTestBase {
$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 @@ class ImageThemeFunctionTest extends WebTestBase {
$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);