You are here

public function PluginTestBase::testStateContextExceptionSetProperty in Purge 8.3

Test that you can't set a property without specifying the state context.

See also

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

File

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

Class

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

Namespace

Drupal\Tests\purge\Kernel\Invalidation

Code

public function testStateContextExceptionSetProperty() : void {
  $i = $this
    ->getInstance();
  $this
    ->expectException(\LogicException::class);
  $this
    ->expectExceptionMessage('Call ::setStateContext() before setting properties!');
  $i
    ->setProperty('my_setting', FALSE);
}