You are here

public function AspectSwitcherTest::testAspectSwitcherFailureOnLandscapeCircularReference in Image Effects 8.2

Same name and namespace in other branches
  1. 8.3 tests/src/Functional/Effect/AspectSwitcherTest.php \Drupal\Tests\image_effects\Functional\Effect\AspectSwitcherTest::testAspectSwitcherFailureOnLandscapeCircularReference()
  2. 8 tests/src/Functional/Effect/AspectSwitcherTest.php \Drupal\Tests\image_effects\Functional\Effect\AspectSwitcherTest::testAspectSwitcherFailureOnLandscapeCircularReference()

Image style save should fail if AspectSwitcher effect has circular ref.

File

tests/src/Functional/Effect/AspectSwitcherTest.php, line 209

Class

AspectSwitcherTest
AspectSwitcher effect test.

Namespace

Drupal\Tests\image_effects\Functional\Effect

Code

public function testAspectSwitcherFailureOnLandscapeCircularReference() {
  $effect = [
    'id' => 'image_effects_aspect_switcher',
    'data' => [
      'landscape_image_style' => $this->testImageStyleName,
      'portrait_image_style' => 'portrait_image_style_test',
      'ratio_adjustment' => 1,
    ],
  ];
  $this->testImageStyle
    ->addImageEffect($effect);
  $this
    ->setExpectedException(ConfigValueException::class, "You can not select the Image Effects Test image style itself for the landscape style");
  $this->testImageStyle
    ->save();
}