protected function BlockContentFieldFilterTest::assertPageCounts in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/block_content/src/Tests/Views/BlockContentFieldFilterTest.php \Drupal\block_content\Tests\Views\BlockContentFieldFilterTest::assertPageCounts()
Asserts that the given block_content translation counts are correct.
Parameters
string $path: Path of the page to test.
array $counts: Array whose keys are languages, and values are the number of times that translation should be shown on the given page.
string $message: Message suffix to display.
1 call to BlockContentFieldFilterTest::assertPageCounts()
- BlockContentFieldFilterTest::testFilters in core/
modules/ block_content/ src/ Tests/ Views/ BlockContentFieldFilterTest.php - Tests body and info filters.
File
- core/
modules/ block_content/ src/ Tests/ Views/ BlockContentFieldFilterTest.php, line 104 - Contains \Drupal\block_content\Tests\Views\BlockContentFieldFilterTest.
Class
- BlockContentFieldFilterTest
- Tests block_content field filters with translations.
Namespace
Drupal\block_content\Tests\ViewsCode
protected function assertPageCounts($path, $counts, $message) {
// Get the text of the page.
$this
->drupalGet($path);
$text = $this
->getTextContent();
foreach ($counts as $langcode => $count) {
$this
->assertEqual(substr_count($text, $this->blockContentInfos[$langcode]), $count, 'Translation ' . $langcode . ' has count ' . $count . ' with ' . $message);
}
}