You are here

protected function EntityQueryRelationshipTest::assertResults in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Entity/EntityQueryRelationshipTest.php \Drupal\KernelTests\Core\Entity\EntityQueryRelationshipTest::assertResults()
  2. 10 core/tests/Drupal/KernelTests/Core/Entity/EntityQueryRelationshipTest.php \Drupal\KernelTests\Core\Entity\EntityQueryRelationshipTest::assertResults()

Assert the results.

Parameters

array $expected: A list of indexes in the $this->entities array.

1 call to EntityQueryRelationshipTest::assertResults()
EntityQueryRelationshipTest::testQuery in core/tests/Drupal/KernelTests/Core/Entity/EntityQueryRelationshipTest.php
Tests querying.

File

core/tests/Drupal/KernelTests/Core/Entity/EntityQueryRelationshipTest.php, line 228

Class

EntityQueryRelationshipTest
Tests the Entity Query relationship API.

Namespace

Drupal\KernelTests\Core\Entity

Code

protected function assertResults($expected) {
  $expected_count = count($expected);
  $this
    ->assertCount($expected_count, $this->queryResults);
  foreach ($expected as $key) {
    $id = $this->entities[$key]
      ->id();
    $this
      ->assertEquals($id, $this->queryResults[$id]);
  }
}