function TitleClosureTest::testReferenceToNonClosureTitle
Tests that a reference to an attribute without a closure is reported.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Routing/ TitleClosureTest.php, line 85
Class
- TitleClosureTest
- Tests title closures declared on Route attributes.
Namespace
Drupal\KernelTests\Core\RoutingCode
public function testReferenceToNonClosureTitle() : void {
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessageIs('The Route attribute at index 0 on ' . TestAttributes::class . '::allProperties() does not have a closure title.');
Route::getTitleClosure(TestAttributes::class, 'allProperties', 0);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.