setupAccessArgumentsResolverFactory example

$this->setupAccessChecker();

    // An access checker got setup, but the routes haven't been setup using     // setChecks.     foreach ($route_matches as $route_match) {
      $this->assertEquals(FALSE, $this->accessManager->check($route_match$this->account));
      $this->assertEquals(AccessResult::neutral()$this->accessManager->check($route_match$this->account, NULL, TRUE));
    }

    // Now applicable access checks have been saved on each route object.     $this->checkProvider->setChecks($this->routeCollection);
    $this->setupAccessArgumentsResolverFactory();

    $this->assertEquals(FALSE, $this->accessManager->check($route_matches['test_route_1']$this->account));
    $this->assertEquals(TRUE, $this->accessManager->check($route_matches['test_route_2']$this->account));
    $this->assertEquals(FALSE, $this->accessManager->check($route_matches['test_route_3']$this->account));
    $this->assertEquals(TRUE, $this->accessManager->check($route_matches['test_route_4']$this->account));
    $this->assertEquals(AccessResult::neutral()$this->accessManager->check($route_matches['test_route_1']$this->account, NULL, TRUE));
    $this->assertEquals(AccessResult::allowed()$this->accessManager->check($route_matches['test_route_2']$this->account, NULL, TRUE));
    $this->assertEquals(AccessResult::forbidden()$this->accessManager->check($route_matches['test_route_3']$this->account, NULL, TRUE));
    $this->assertEquals(AccessResult::allowed()$this->accessManager->check($route_matches['test_route_4']$this->account, NULL, TRUE));
  }

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