You are here

public function AspectSwitcherTest::testAspectSwitcherFailureOnPortraitCircularReference in Image Effects 8.3

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

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

File

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

Class

AspectSwitcherTest
AspectSwitcher effect test.

Namespace

Drupal\Tests\image_effects\Functional\Effect

Code

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