You are here

protected function SelectionTest::assertResults in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/field/tests/src/Kernel/EntityReference/Views/SelectionTest.php \Drupal\Tests\field\Kernel\EntityReference\Views\SelectionTest::assertResults()

Confirm the expected results are returned.

Parameters

array $result: Query results keyed by node type and nid.

1 call to SelectionTest::assertResults()
SelectionTest::testSelectionHandler in core/modules/field/tests/src/Kernel/EntityReference/Views/SelectionTest.php
Tests the selection handler.

File

core/modules/field/tests/src/Kernel/EntityReference/Views/SelectionTest.php, line 154

Class

SelectionTest
Tests entity reference selection handler.

Namespace

Drupal\Tests\field\Kernel\EntityReference\Views

Code

protected function assertResults(array $result) {
  foreach ($result as $node_type => $values) {
    foreach ($values as $nid => $label) {
      $this
        ->assertSame($node_type, $this->nodes[$nid]
        ->bundle());
      $this
        ->assertSame(trim(strip_tags($label)), Html::escape($this->nodes[$nid]
        ->label()));
    }
  }
}