You are here

public function PluginTestBase::testCodeContract in Purge 8.3

Tests the code contract strictly enforced on invalidation type plugins.

File

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

Class

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

Namespace

Drupal\Tests\purge\Kernel\Invalidation

Code

public function testCodeContract() : void {
  $this
    ->assertTrue($this
    ->getInstance() instanceof ImmutableInvalidationInterface);
  $this
    ->assertTrue($this
    ->getInstance() instanceof InvalidationInterface);
  $this
    ->assertTrue($this
    ->getInstance() instanceof ImmutableInvalidationBase);
  $this
    ->assertTrue($this
    ->getInstance() instanceof InvalidationBase);
  $this
    ->assertTrue($this
    ->getImmutableInstance() instanceof ImmutableInvalidationInterface);
  $this
    ->assertFalse($this
    ->getImmutableInstance() instanceof InvalidationInterface);
  $this
    ->assertTrue($this
    ->getImmutableInstance() instanceof ImmutableInvalidationBase);
  $this
    ->assertFalse($this
    ->getImmutableInstance() instanceof InvalidationBase);
}