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