You are here

public function ConditionManagerTest::testContextDefinitionAnnotations in Rules 8.3

@covers ::getDiscovery

File

tests/src/Unit/Integration/Condition/ConditionManagerTest.php, line 19

Class

ConditionManagerTest
Tests the Rules condition manager.

Namespace

Drupal\Tests\rules\Unit\Integration\Condition

Code

public function testContextDefinitionAnnotations() {
  $definitions = $this->conditionManager
    ->getDefinitions();

  // Make sure all context definitions are using the class provided by Rules.
  foreach ($definitions as $definition) {
    if (!empty($definition['context_definitions'])) {
      foreach ($definition['context_definitions'] as $context_definition) {
        $this
          ->assertInstanceOf(ContextDefinitionInterface::class, $context_definition);
      }
    }
  }
}