public function ConditionTest::testOr in Apigee Edge 8
Tests the "OR" conjunction.
File
- tests/
src/ Unit/ ConditionTest.php, line 125
Class
- ConditionTest
- Entity query condition tests.
Namespace
Drupal\Tests\apigee_edge\UnitCode
public function testOr() {
$value0 = $this
->randomData()[0];
$value1 = $this
->randomData()[1];
$cond = $this
->mockCondition('OR');
$cond
->condition('id', $value0);
$cond
->condition('id', $value1);
$this
->assertFilters($cond, function (EntityInterface $item) use ($value0, $value1) : bool {
return $item
->id() == $value0 || $item
->id() == $value1;
});
}