protected function BlockContentIntegrationTest::assertIds in Drupal 10
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()
- 9 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.
@internal
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 65
Class
- BlockContentIntegrationTest
- Tests the block_content integration into views.
Namespace
Drupal\Tests\block_content\Functional\ViewsCode
protected function assertIds(array $expected_ids = []) : void {
$result = $this
->xpath('//span[@class="field-content"]');
$ids = [];
foreach ($result as $element) {
$ids[] = $element
->getText();
}
$this
->assertEquals($expected_ids, $ids);
}