You are here

public function EntityResolverManagerTest::testSetRouteOptionsWithStandardRouteWithArgument 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::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
Contains \Drupal\Tests\Core\Entity\EntityResolverManagerTest.

Class

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

Namespace

Drupal\Tests\Core\Entity

Code

public function testSetRouteOptionsWithStandardRouteWithArgument($controller) {
  $route = new Route('/example/{argument}', array(
    '_controller' => $controller,
    'argument' => 'test',
  ));
  $defaults = $route
    ->getDefaults();
  $this->entityResolverManager
    ->setRouteOptions($route);
  $this
    ->assertEquals($defaults, $route
    ->getDefaults());
  $this
    ->assertEmpty($route
    ->getOption('parameters'));
}