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