protected function BlockContentIntegrationTest::assertIds in Drupal 9
Same name and namespace in other branches
- 8 core/modules/block_content/tests/src/Functional/Views/BlockContentIntegrationTest.php \Drupal\Tests\block_content\Functional\Views\BlockContentIntegrationTest::assertIds()
Ensures that a list of block_contents appear on the page.
Parameters
array $expected_ids: An array of block_content IDs.
1 call to BlockContentIntegrationTest::assertIds()
- BlockContentIntegrationTest::testBlockContentViewTypeArgument in core/
modules/ block_content/ tests/ src/ Functional/ Views/ BlockContentIntegrationTest.php - Tests basic block_content view with a block_content_type argument.
File
- core/
modules/ block_content/ tests/ src/ Functional/ Views/ BlockContentIntegrationTest.php, line 63
Class
- BlockContentIntegrationTest
- Tests the block_content integration into views.
Namespace
Drupal\Tests\block_content\Functional\ViewsCode
protected function assertIds(array $expected_ids = []) {
$result = $this
->xpath('//span[@class="field-content"]');
$ids = [];
foreach ($result as $element) {
$ids[] = $element
->getText();
}
$this
->assertEquals($expected_ids, $ids);
}