public function RulesComponentActionTest::testActionAvailable in Rules 8.3
Tests that a rule can be used as action.
File
- tests/
src/ Unit/ Integration/ RulesAction/ RulesComponentActionTest.php, line 23
Class
- RulesComponentActionTest
- Tests for exposing Rules components as action plugins.
Namespace
Drupal\Tests\rules\Unit\Integration\RulesActionCode
public function testActionAvailable() {
$rule = $this->rulesExpressionManager
->createRule();
$rules_config = new RulesComponentConfig([
'id' => 'test_rule',
'label' => 'Test rule',
], 'rules_component');
$rules_config
->setExpression($rule);
$this
->prophesizeStorage([
$rules_config,
]);
$definition = $this->actionManager
->getDefinition('rules_component:test_rule');
$this
->assertEquals('Components', $definition['category']);
$this
->assertEquals('Rule: Test rule', (string) $definition['label']);
}