function FilterDateTest::assertIds
Same name in other branches
- 9 core/modules/datetime/tests/src/Functional/Views/FilterDateTest.php \Drupal\Tests\datetime\Functional\Views\FilterDateTest::assertIds()
- 11.x core/modules/datetime/tests/src/Functional/Views/FilterDateTest.php \Drupal\Tests\datetime\Functional\Views\FilterDateTest::assertIds()
Ensures that a given list of items appear on the view result.
Parameters
array $expected_ids: An array of IDs.
1 call to FilterDateTest::assertIds()
- FilterDateTest::testExposedGroupedFilters in core/
modules/ datetime/ tests/ src/ Functional/ Views/ FilterDateTest.php - Tests exposed grouped filters.
File
-
core/
modules/ datetime/ tests/ src/ Functional/ Views/ FilterDateTest.php, line 204
Class
- FilterDateTest
- Tests Views filters for datetime fields.
Namespace
Drupal\Tests\datetime\Functional\ViewsCode
protected function assertIds(array $expected_ids = []) : void {
// First verify the count.
$elements = $this->cssSelect('.views-row .field-content');
$this->assertCount(count($expected_ids), $elements);
$actual_ids = [];
foreach ($elements as $element) {
$actual_ids[] = (int) $element->getText();
}
$this->assertEquals($expected_ids, $actual_ids);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.