You are here

protected function ImageReplaceTestBase::createImageStyle in Image Replace 7

Same name and namespace in other branches
  1. 8 src/Tests/ImageReplaceTestBase.php \Drupal\image_replace\Tests\ImageReplaceTestBase::createImageStyle()

Create an image style containing the image repace effect.

Parameters

string $name: The name of the new image style (all lowercase).

Return value

array The newly created image style array.

3 calls to ImageReplaceTestBase::createImageStyle()
AdminTest::setUp in src/Tests/AdminTest.php
EntityTest::setUp in src/Tests/EntityTest.php
ReplaceEffectTest::testReplaceEffect in src/Tests/ReplaceEffectTest.php
Tests functionality of the replace image effect.

File

src/Tests/ImageReplaceTestBase.php, line 62

Class

ImageReplaceTestBase
Tests functionality of the replace image effect.

Namespace

Drupal\image_replace\Tests

Code

protected function createImageStyle($name) {

  // Create an image style containing the replace effect.
  $style = image_style_save(array(
    'name' => $name,
    'label' => $this
      ->randomString(),
  ));
  $effect = array(
    'name' => 'image_replace',
    'data' => array(),
    'isid' => $style['isid'],
  );
  image_effect_save($effect);
  return $style;
}