function ArgumentsResolverTest::testGetWildcardArgumentNoTypeHint
Tests getArgument() with a wildcard parameter with no type hint.
Without the type hint, the wildcard object will not be passed to the callable.
File
-
core/
tests/ Drupal/ Tests/ Component/ Utility/ ArgumentsResolverTest.php, line 128
Class
Namespace
Drupal\Tests\Component\UtilityCode
public function testGetWildcardArgumentNoTypeHint() : void {
$a = $this->getMockBuilder('\\Drupal\\Tests\\Component\\Utility\\Test1Interface')
->getMock();
$wildcards = [
$a,
];
$resolver = new ArgumentsResolver([], [], $wildcards);
$callable = function ($route) {
};
$this->expectException(\RuntimeException::class);
$this->expectExceptionMessage('requires a value for the "$route" argument.');
$resolver->getArguments($callable);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.