public function IntegrityCheckTest::testInvalidAction in Rules 8.3
Tests that an invalid action plugin ID results in a violation.
File
- tests/
src/ Unit/ Integration/ Engine/ IntegrityCheckTest.php, line 116
Class
- IntegrityCheckTest
- Test the integrity check functionality during configuration time.
Namespace
Drupal\Tests\rules\Unit\Integration\EngineCode
public function testInvalidAction() {
$rule = $this->rulesExpressionManager
->createRule();
$action = $this->rulesExpressionManager
->createAction('invalid_action_id');
$rule
->addExpressionObject($action);
$violations = RulesComponent::create($rule)
->checkIntegrity();
$this
->assertEquals(1, iterator_count($violations));
$this
->assertEquals('Action plugin <em class="placeholder">invalid_action_id</em> does not exist', (string) $violations[0]
->getMessage());
$this
->assertEquals($action
->getUuid(), $violations[0]
->getUuid());
}