public function RuleExpressionTest::testConditionFails in Rules 8.3
Tests that an action does not fire if a condition fails.
@covers ::execute
File
- tests/
src/ Unit/ RuleExpressionTest.php, line 125
Class
- RuleExpressionTest
- @coversDefaultClass \Drupal\rules\Plugin\RulesExpression\RuleExpression @group Rules
Namespace
Drupal\Tests\rules\UnitCode
public function testConditionFails() {
// The execute method on the action must never be called.
$this->testActionExpression
->executeWithState(Argument::type(ExecutionStateInterface::class))
->shouldNotBeCalled();
$this->rule
->addExpressionObject($this->falseConditionExpression
->reveal())
->addExpressionObject($this->testActionExpression
->reveal())
->execute();
}