function FrontPageTest::assertNotInResultSet
Same name in other branches
- 8.9.x core/modules/node/tests/src/Functional/Views/FrontPageTest.php \Drupal\Tests\node\Functional\Views\FrontPageTest::assertNotInResultSet()
- 10 core/modules/node/tests/src/Functional/Views/FrontPageTest.php \Drupal\Tests\node\Functional\Views\FrontPageTest::assertNotInResultSet()
- 11.x core/modules/node/tests/src/Functional/Views/FrontPageTest.php \Drupal\Tests\node\Functional\Views\FrontPageTest::assertNotInResultSet()
Verifies that an amount of nids aren't in the result.
@internal
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/ tests/ src/ Functional/ Views/ FrontPageTest.php - Tests the frontpage.
File
-
core/
modules/ node/ tests/ src/ Functional/ Views/ FrontPageTest.php, line 166
Class
- FrontPageTest
- Tests the default frontpage provided by views.
Namespace
Drupal\Tests\node\Functional\ViewsCode
protected function assertNotInResultSet(ViewExecutable $view, array $not_expected_nids, string $message = '') : void {
$found_nids = array_filter($view->result, function ($row) use ($not_expected_nids) {
return in_array($row->nid, $not_expected_nids);
});
$this->assertEmpty($found_nids, $message);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.