You are here

protected function ConditionTest::assertFilters in Apigee Edge 8

Asserts that a Condition object.

Parameters

\Drupal\apigee_edge\Entity\Query\Condition $condition: A Condition object to test.

callable $filter: A filter to verify the results.

7 calls to ConditionTest::assertFilters()
ConditionTest::testAnd in tests/src/Unit/ConditionTest.php
Tests the "AND" conjunction.
ConditionTest::testBool in tests/src/Unit/ConditionTest.php
Tests a boolean condition.
ConditionTest::testComplex in tests/src/Unit/ConditionTest.php
Tests a complex condition.
ConditionTest::testEmptyCondition in tests/src/Unit/ConditionTest.php
Tests an empty condition (every result will be returned).
ConditionTest::testIn in tests/src/Unit/ConditionTest.php
Tests an array contains ("IN" keyword in SQL) condition.

... See full list

File

tests/src/Unit/ConditionTest.php, line 312

Class

ConditionTest
Entity query condition tests.

Namespace

Drupal\Tests\apigee_edge\Unit

Code

protected function assertFilters(Condition $condition, callable $filter) : void {
  $expected = array_filter($this->entities, $filter);
  $actual = array_filter($this->entities, $condition
    ->compile(NULL));
  $this
    ->assertEquals($expected, $actual);
}