You are here

protected function SelectionTest::assertResults in Zircon Profile 8

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

Confirm the expected results are returned.

Parameters

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

2 calls to SelectionTest::assertResults()
SelectionTest::testSelectionHandler in core/modules/field/src/Tests/EntityReference/Views/SelectionTest.php
Tests the selection handler.
SelectionTest::testSelectionHandlerRelationship in core/modules/field/src/Tests/EntityReference/Views/SelectionTest.php
Tests the selection handler with a relationship.

File

core/modules/field/src/Tests/EntityReference/Views/SelectionTest.php, line 88
Contains \Drupal\field\Tests\EntityReference\Views\SelectionTest.

Class

SelectionTest
Tests entity reference selection handler.

Namespace

Drupal\field\Tests\EntityReference\Views

Code

protected function assertResults(array $result) {
  $success = FALSE;
  foreach ($result as $node_type => $values) {
    foreach ($values as $nid => $label) {
      if (!($success = $this->nodes[$node_type][$nid] == trim(strip_tags($label)))) {

        // There was some error, so break.
        break;
      }
    }
  }
  $this
    ->assertTrue($success, 'Views selection handler returned expected values.');
}