ActiveWorkspaceCheck example



  /** * @covers ::access * @dataProvider providerTestAccess */
  public function testAccess($requirements$has_active_workspace$access, array $contexts = []) {
    $route = new Route('', []$requirements);

    $workspace_manager = $this->prophesize(WorkspaceManagerInterface::class);
    $workspace_manager->hasActiveWorkspace()->willReturn($has_active_workspace);
    $access_check = new ActiveWorkspaceCheck($workspace_manager->reveal());

    $access_result = AccessResult::allowedIf($access)->addCacheContexts($contexts);
    $this->assertEquals($access_result$access_check->access($route));
  }

}
Home | Imprint | This part of the site doesn't use cookies.