function EntityResolverManagerTest::testSetRouteOptionsWithStandardRouteWithArgument
Same name in other branches
- 8.9.x core/tests/Drupal/Tests/Core/Entity/EntityResolverManagerTest.php \Drupal\Tests\Core\Entity\EntityResolverManagerTest::testSetRouteOptionsWithStandardRouteWithArgument()
- 10 core/tests/Drupal/Tests/Core/Entity/EntityResolverManagerTest.php \Drupal\Tests\Core\Entity\EntityResolverManagerTest::testSetRouteOptionsWithStandardRouteWithArgument()
- 11.x core/tests/Drupal/Tests/Core/Entity/EntityResolverManagerTest.php \Drupal\Tests\Core\Entity\EntityResolverManagerTest::testSetRouteOptionsWithStandardRouteWithArgument()
Tests setRouteOptions() with a controller with a non entity argument.
@covers ::setRouteOptions @covers ::getControllerClass
@dataProvider providerTestSetRouteOptionsWithStandardRouteWithArgument
File
-
core/
tests/ Drupal/ Tests/ Core/ Entity/ EntityResolverManagerTest.php, line 105
Class
- EntityResolverManagerTest
- @coversDefaultClass \Drupal\Core\Entity\EntityResolverManager @group Entity
Namespace
Drupal\Tests\Core\EntityCode
public function testSetRouteOptionsWithStandardRouteWithArgument($controller) {
$route = new Route('/example/{argument}', [
'_controller' => $controller,
'argument' => 'test',
]);
$defaults = $route->getDefaults();
$this->entityResolverManager
->setRouteOptions($route);
$this->assertEquals($defaults, $route->getDefaults());
$this->assertEmpty($route->getOption('parameters'));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.