You are here

public function PluginTestBase::testStateContextExceptionDeleteProperty in Purge 8.3

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

See also

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

File

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

Class

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

Namespace

Drupal\Tests\purge\Kernel\Invalidation

Code

public function testStateContextExceptionDeleteProperty() : void {
  $i = $this
    ->getInstance();
  $this
    ->expectException(\LogicException::class);
  $this
    ->expectExceptionMessage('Call ::setStateContext() before deleting properties!');
  $i
    ->deleteProperty('my_setting');
}