function Breadcrumb404Test::testBreadcrumbOn404Pages

Same name in other branches
  1. 9 core/tests/Drupal/FunctionalTests/Breadcrumb/Breadcrumb404Test.php \Drupal\FunctionalTests\Breadcrumb\Breadcrumb404Test::testBreadcrumbOn404Pages()
  2. 8.9.x core/tests/Drupal/FunctionalTests/Breadcrumb/Breadcrumb404Test.php \Drupal\FunctionalTests\Breadcrumb\Breadcrumb404Test::testBreadcrumbOn404Pages()
  3. 11.x 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 32

Class

Breadcrumb404Test
Tests the breadcrumb of 404 pages.

Namespace

Drupal\FunctionalTests\Breadcrumb

Code

public function testBreadcrumbOn404Pages() : void {
    $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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.