You are here

public function RngEventAccessTest::testAuthenticated in RNG - Events and Registrations 8

Same name and namespace in other branches
  1. 8.2 tests/src/Kernel/RngEventAccessTest.php \Drupal\Tests\rng\Kernel\RngEventAccessTest::testAuthenticated()
  2. 3.x tests/src/Kernel/RngEventAccessTest.php \Drupal\Tests\rng\Kernel\RngEventAccessTest::testAuthenticated()

Test authenticated user without permissions.

File

tests/src/Kernel/RngEventAccessTest.php, line 140

Class

RngEventAccessTest
Tests manage event access control. to register for events..

Namespace

Drupal\Tests\rng\Kernel

Code

public function testAuthenticated() {
  $event = EntityTest::create();
  $event
    ->save();
  $parameters['entity_test'] = $event;
  $account = $this
    ->drupalCreateUser();
  foreach ($this->routes as $route_name) {
    $route = $this->routeProvider
      ->getRouteByName($route_name);
    $route_match = new RouteMatch($route_name, $route, $parameters);
    $this
      ->assertFalse($this->accessManager
      ->check($route_match, $account), 'No authenticated access to: ' . $route_name);
  }
}