function ActiveWorkspaceCheckTest::testAccess
Tests access.
@legacy-covers ::access
Attributes
#[DataProvider('providerTestAccess')]
File
- 
              core/
modules/ workspaces/ tests/ src/ Unit/ ActiveWorkspaceCheckTest.php, line 69  
Class
Namespace
Drupal\Tests\workspaces\UnitCode
public function testAccess($requirements, $has_active_workspace, $access, array $contexts = []) : void {
  $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));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.