WorkspaceRequestSubscriber example

/** * @covers ::onKernelRequest */
  public function testOnKernelRequestWithCacheableRouteProvider() {
    $route_provider = $this->prophesize(CacheableRouteProviderInterface::class);
    $route_provider->addExtraCacheKeyPart('workspace', 'test')->shouldBeCalled();

    // Check that WorkspaceRequestSubscriber::onKernelRequest() calls     // addExtraCacheKeyPart() on a route provider that implements     // CacheableRouteProviderInterface.     $workspace_request_subscriber = new WorkspaceRequestSubscriber($this->aliasManager, $this->currentPath, $route_provider->reveal()$this->workspaceManager->reveal());
    $event = $this->prophesize(RequestEvent::class)->reveal();
    $this->assertNull($workspace_request_subscriber->onKernelRequest($event));
  }

  /** * @covers ::onKernelRequest */
  public function testOnKernelRequestWithoutCacheableRouteProvider() {
    $route_provider = $this->prophesize(RouteProviderInterface::class);

    // Check that WorkspaceRequestSubscriber::onKernelRequest() doesn't call
Home | Imprint | This part of the site doesn't use cookies.