function IntegrityCheckTest::testRefinedContextViolation
Tests that refined context is respected when checking context.
File
-
tests/
src/ Unit/ Integration/ Engine/ IntegrityCheckTest.php, line 356
Class
- IntegrityCheckTest
- Test the integrity check functionality during configuration time.
Namespace
Drupal\Tests\rules\Unit\Integration\EngineCode
public function testRefinedContextViolation() {
$rule = $this->rulesExpressionManager
->createRule();
$rule->addAction('rules_variable_add', ContextConfig::create()->setValue('type', 'integer')
->map('value', 'text'));
$violation_list = RulesComponent::create($rule)->addContextDefinition('text', ContextDefinition::create('string'))
->checkIntegrity();
$this->assertCount(1, $violation_list);
}