function AndExpressionTest::testOneCondition

Tests one condition.

File

tests/src/Unit/AndExpressionTest.php, line 35

Class

AndExpressionTest
@coversDefaultClass \Drupal\rules\Plugin\RulesExpression\AndExpression[[api-linebreak]] @group Rules

Namespace

Drupal\Tests\rules\Unit

Code

public function testOneCondition() {
  // The method on the test condition must be called once.
  $this->trueConditionExpression
    ->executeWithState(Argument::type(ExecutionStateInterface::class))
    ->shouldBeCalledTimes(1);
  $this->and
    ->addExpressionObject($this->trueConditionExpression
    ->reveal());
  $this->assertTrue($this->and
    ->execute(), 'Single condition returns TRUE.');
}