function LatestRevisionFilterTest::assertNotInResultSet

Same name and namespace in other branches
  1. 9 core/modules/views/tests/src/Kernel/Entity/LatestRevisionFilterTest.php \Drupal\Tests\views\Kernel\Entity\LatestRevisionFilterTest::assertNotInResultSet()
  2. 10 core/modules/views/tests/src/Kernel/Entity/LatestRevisionFilterTest.php \Drupal\Tests\views\Kernel\Entity\LatestRevisionFilterTest::assertNotInResultSet()
  3. 11.x core/modules/views/tests/src/Kernel/Entity/LatestRevisionFilterTest.php \Drupal\Tests\views\Kernel\Entity\LatestRevisionFilterTest::assertNotInResultSet()

Asserts that a list of revision IDs are not in the result.

Parameters

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

array $not_expected_revision_ids: An array of revision IDs which should not be part of the result set.

1 call to LatestRevisionFilterTest::assertNotInResultSet()
LatestRevisionFilterTest::testLatestRevisionFilter in core/modules/views/tests/src/Kernel/Entity/LatestRevisionFilterTest.php
Tests the 'Latest revision' filter.

File

core/modules/views/tests/src/Kernel/Entity/LatestRevisionFilterTest.php, line 130

Class

LatestRevisionFilterTest
Tests the 'Latest revision' filter.

Namespace

Drupal\Tests\views\Kernel\Entity

Code

protected function assertNotInResultSet(ViewExecutable $view, array $not_expected_revision_ids) {
    $found_revision_ids = array_filter($view->result, function ($row) use ($not_expected_revision_ids) {
        return in_array($row->vid, $not_expected_revision_ids);
    });
    $this->assertEmpty($found_revision_ids);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.