You are here

protected function FrontPageTest::assertNotInResultSet in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/node/src/Tests/Views/FrontPageTest.php \Drupal\node\Tests\Views\FrontPageTest::assertNotInResultSet()

Verifies that an amount of nids aren't in the result.

Parameters

\Drupal\views\ViewExecutable $view: An executed View.

array $not_expected_nids: An array of nids which should not be part of the resultset.

string $message: (optional) A custom message to display with the assertion.

1 call to FrontPageTest::assertNotInResultSet()
FrontPageTest::testFrontPage in core/modules/node/src/Tests/Views/FrontPageTest.php
Tests the frontpage.

File

core/modules/node/src/Tests/Views/FrontPageTest.php, line 166
Contains \Drupal\node\Tests\Views\FrontPageTest.

Class

FrontPageTest
Tests the default frontpage provided by views.

Namespace

Drupal\node\Tests\Views

Code

protected function assertNotInResultSet(ViewExecutable $view, array $not_expected_nids, $message = '') {
  $found_nids = array_filter($view->result, function ($row) use ($not_expected_nids) {
    return in_array($row->nid, $not_expected_nids);
  });
  $this
    ->assertFalse($found_nids, $message);
}