You are here

public function EntityResolverManagerTest::testSetRouteOptionsWithEntityListRoute in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Entity/EntityResolverManagerTest.php \Drupal\Tests\Core\Entity\EntityResolverManagerTest::testSetRouteOptionsWithEntityListRoute()

Tests setRouteOptions() with an _entity_list route.

@covers ::setRouteOptions @covers ::getControllerClass @covers ::getEntityTypes @covers ::setParametersFromReflection @covers ::setParametersFromEntityInformation

File

core/tests/Drupal/Tests/Core/Entity/EntityResolverManagerTest.php, line 352
Contains \Drupal\Tests\Core\Entity\EntityResolverManagerTest.

Class

EntityResolverManagerTest
@coversDefaultClass \Drupal\Core\Entity\EntityResolverManager @group Entity

Namespace

Drupal\Tests\Core\Entity

Code

public function testSetRouteOptionsWithEntityListRoute() {
  $this
    ->setupEntityTypes();
  $route = new Route('/example/{entity_test}', array(
    '_entity_list' => 'entity_test',
  ));
  $defaults = $route
    ->getDefaults();
  $this->entityResolverManager
    ->setRouteOptions($route);
  $this
    ->assertEquals($defaults, $route
    ->getDefaults());
  $parameters = $route
    ->getOption('parameters');
  $this
    ->assertNull($parameters);
}