You are here

protected function RouteTest::setUp in GraphQL 8.3

Overrides GraphQLCoreTestBase::setUp

File

modules/graphql_core/tests/src/Kernel/Routing/RouteTest.php, line 25

Class

RouteTest
Test plugin based schema generation.

Namespace

Drupal\Tests\graphql_core\Kernel\Routing

Code

protected function setUp() {
  parent::setUp();
  $aliasManager = $this
    ->prophesize(AliasManagerInterface::class);
  $aliasManager
    ->getAliasByPath('/graphql/test/a', Argument::any())
    ->willReturn('/my/other/alias');
  $urlGenerator = $this
    ->prophesize(UrlGeneratorInterface::class);
  $urlGenerator
    ->getPathFromRoute('graphql_context_test.a', [])
    ->willReturn('graphql/test/a');
  $urlGenerator
    ->generateFromRoute('graphql_context_test.a', [], [
    'query' => [],
  ], TRUE)
    ->willReturn((new GeneratedUrl())
    ->setGeneratedUrl('/my/other/alias'));
  $this->container
    ->set('path_alias.manager', $aliasManager
    ->reveal());
  $this->container
    ->set('url_generator', $urlGenerator
    ->reveal());
}