You are here

public function PluginTestBase::testValidExpressions in Purge 8.3

Test if all valid string expressions properly instantiate the object.

See also

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

File

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

Class

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

Namespace

Drupal\Tests\purge\Kernel\Invalidation

Code

public function testValidExpressions() : void {
  if (is_null($this->expressions)) {
    $this
      ->assertInstanceOf(InvalidationInterface::class, $this->purgeInvalidationFactory
      ->get($this->pluginId));
  }
  else {
    foreach ($this->expressions as $e) {
      $this
        ->assertInstanceOf(InvalidationInterface::class, $this->purgeInvalidationFactory
        ->get($this->pluginId, $e));
    }
  }
}