You are here

public function PluginTestBase::testStateSetInGeneralContext in Purge 8.3

Test exception when setting state in NULL context.

See also

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

File

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

Class

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

Namespace

Drupal\Tests\purge\Kernel\Invalidation

Code

public function testStateSetInGeneralContext() : void {
  $i = $this
    ->getInstance();
  $this
    ->expectException(\LogicException::class);
  $this
    ->expectExceptionMessage('State cannot be set in NULL context!');
  $i
    ->setState(InvalidationInterface::FAILED);
}