function TitleClosureTest::testStaleReference
Same name and namespace in other branches
- 11.x core/tests/Drupal/KernelTests/Core/Routing/TitleClosureTest.php \Drupal\KernelTests\Core\Routing\TitleClosureTest::testStaleReference()
Tests that a stale reference to a missing attribute is reported.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Routing/ TitleClosureTest.php, line 76
Class
- TitleClosureTest
- Tests title closures declared on Route attributes.
Namespace
Drupal\KernelTests\Core\RoutingCode
public function testStaleReference() : void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessageIs('There is no Route attribute at index 2 on ' . TestAttributes::class . '::titleClosure().');
Route::getTitleClosure(TestAttributes::class, 'titleClosure', 2);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.