You are here

public function PluginTestBase::testStateSwitchBadBehavior in Purge 8.3

Test exception when switching away from the 'FRESH' state.

See also

\Drupal\purge\Plugin\Purge\Invalidation\InvalidationInterface::setStateContext

File

tests/src/Kernel/Invalidation/PluginTestBase.php, line 278

Class

PluginTestBase
Provides an abstract test class to thoroughly test invalidation types.

Namespace

Drupal\Tests\purge\Kernel\Invalidation

Code

public function testStateSwitchBadBehavior() : void {
  $i = $this
    ->getInstance();
  $i
    ->setStateContext('test');
  $this
    ->expectException(BadPluginBehaviorException::class);
  $this
    ->expectExceptionMessage('Only NOT_SUPPORTED, PROCESSING, SUCCEEDED and FAILED are valid outbound states.');
  $i
    ->setStateContext(NULL);
}