function EntityResolverManagerTest::testSetRouteOptionsWithEntityFormUpcasting
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Entity/EntityResolverManagerTest.php \Drupal\Tests\Core\Entity\EntityResolverManagerTest::testSetRouteOptionsWithEntityFormUpcasting()
- 8.9.x core/tests/Drupal/Tests/Core/Entity/EntityResolverManagerTest.php \Drupal\Tests\Core\Entity\EntityResolverManagerTest::testSetRouteOptionsWithEntityFormUpcasting()
- 10 core/tests/Drupal/Tests/Core/Entity/EntityResolverManagerTest.php \Drupal\Tests\Core\Entity\EntityResolverManagerTest::testSetRouteOptionsWithEntityFormUpcasting()
Tests setRouteOptions() with an entity type parameter form.
@covers ::setRouteOptions @covers ::getControllerClass @covers ::getEntityTypes @covers ::setParametersFromReflection
File
-
core/
tests/ Drupal/ Tests/ Core/ Entity/ EntityResolverManagerTest.php, line 231
Class
- EntityResolverManagerTest
- @coversDefaultClass \Drupal\Core\Entity\EntityResolverManager @group Entity
Namespace
Drupal\Tests\Core\EntityCode
public function testSetRouteOptionsWithEntityFormUpcasting() : void {
$this->setupEntityTypes();
$route = new Route('/example/{entity_test}', [
'_form' => 'Drupal\\Tests\\Core\\Entity\\BasicForm',
]);
$defaults = $route->getDefaults();
$this->entityResolverManager
->setRouteOptions($route);
$this->assertEquals($defaults, $route->getDefaults());
$parameters = $route->getOption('parameters');
$this->assertEquals([
'entity_test' => [
'type' => 'entity:entity_test',
],
], $parameters);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.