function DataComparisonTest::testConditionEvaluationOperatorGreaterThan
Tests evaluating the condition with the "is greater than" operation.
@covers ::evaluate
File
-
tests/
src/ Unit/ Integration/ Condition/ DataComparisonTest.php, line 172
Class
- DataComparisonTest
- @coversDefaultClass \Drupal\rules\Plugin\Condition\DataComparison @group RulesCondition
Namespace
Drupal\Tests\rules\Unit\Integration\ConditionCode
public function testConditionEvaluationOperatorGreaterThan() {
// Test that when data is greater than value and operation is '>',
// TRUE is returned.
$this->condition
->setContextValue('data', 2)
->setContextValue('operation', '>')
->setContextValue('value', 1);
$this->assertTrue($this->condition
->evaluate());
// Test that when data is less than value and operation is '>',
// FALSE is returned.
$this->condition
->setContextValue('data', 1)
->setContextValue('operation', '>')
->setContextValue('value', 2);
$this->assertFalse($this->condition
->evaluate());
}