function BreadcrumbManagerTest::testBuildWithInvalidBreadcrumbResult
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbManagerTest.php \Drupal\Tests\Core\Breadcrumb\BreadcrumbManagerTest::testBuildWithInvalidBreadcrumbResult()
- 8.9.x core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbManagerTest.php \Drupal\Tests\Core\Breadcrumb\BreadcrumbManagerTest::testBuildWithInvalidBreadcrumbResult()
- 11.x core/tests/Drupal/Tests/Core/Breadcrumb/BreadcrumbManagerTest.php \Drupal\Tests\Core\Breadcrumb\BreadcrumbManagerTest::testBuildWithInvalidBreadcrumbResult()
Tests a breadcrumb builder with a bad return value.
File
-
core/
tests/ Drupal/ Tests/ Core/ Breadcrumb/ BreadcrumbManagerTest.php, line 191
Class
- BreadcrumbManagerTest
- @coversDefaultClass \Drupal\Core\Breadcrumb\BreadcrumbManager @group Breadcrumb
Namespace
Drupal\Tests\Core\BreadcrumbCode
public function testBuildWithInvalidBreadcrumbResult() : void {
$builder = $this->createMock('Drupal\\Core\\Breadcrumb\\BreadcrumbBuilderInterface');
$builder->expects($this->once())
->method('applies')
->willReturn(TRUE);
$builder->expects($this->once())
->method('build')
->willReturn('invalid_result');
$this->breadcrumbManager
->addBuilder($builder, 0);
$this->expectException(\UnexpectedValueException::class);
$this->breadcrumbManager
->build($this->createMock('Drupal\\Core\\Routing\\RouteMatchInterface'));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.