public function Breadcrumb404Test::testBreadcrumbOn404Pages in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/FunctionalTests/Breadcrumb/Breadcrumb404Test.php \Drupal\FunctionalTests\Breadcrumb\Breadcrumb404Test::testBreadcrumbOn404Pages()
Tests that different 404s don't create unnecessary cache entries.
File
- core/
tests/ Drupal/ FunctionalTests/ Breadcrumb/ Breadcrumb404Test.php, line 30
Class
- Breadcrumb404Test
- Tests the breadcrumb of 404 pages.
Namespace
Drupal\FunctionalTests\BreadcrumbCode
public function testBreadcrumbOn404Pages() {
$this
->placeBlock('system_breadcrumb_block', [
'id' => 'breadcrumb',
]);
// Prime the cache first.
$this
->drupalGet('/not-found-1');
$base_count = count($this
->getBreadcrumbCacheEntries());
$this
->drupalGet('/not-found-2');
$next_count = count($this
->getBreadcrumbCacheEntries());
$this
->assertEquals($base_count, $next_count);
$this
->drupalGet('/not-found-3');
$next_count = count($this
->getBreadcrumbCacheEntries());
$this
->assertEquals($base_count, $next_count);
}