function IntegrityCheckTest::testIntegrityCheck

Tests that the integrity check can be invoked.

File

tests/src/Unit/Integration/Engine/IntegrityCheckTest.php, line 23

Class

IntegrityCheckTest
Test the integrity check functionality during configuration time.

Namespace

Drupal\Tests\rules\Unit\Integration\Engine

Code

public function testIntegrityCheck() {
    $rule = $this->rulesExpressionManager
        ->createRule();
    $rule->addAction('rules_entity_save', ContextConfig::create()->map('entity', 'entity'));
    $violation_list = RulesComponent::create($rule)->addContextDefinition('entity', ContextDefinition::create('entity'))
        ->checkIntegrity();
    $this->assertCount(0, $violation_list);
}