public function RngEventAccessTest::testAnonymous in RNG - Events and Registrations 8.2
Same name and namespace in other branches
- 8 tests/src/Kernel/RngEventAccessTest.php \Drupal\Tests\rng\Kernel\RngEventAccessTest::testAnonymous()
- 3.x tests/src/Kernel/RngEventAccessTest.php \Drupal\Tests\rng\Kernel\RngEventAccessTest::testAnonymous()
Test anonymous user.
File
- tests/
src/ Kernel/ RngEventAccessTest.php, line 157
Class
- RngEventAccessTest
- Tests manage event access control. to register for events..
Namespace
Drupal\Tests\rng\KernelCode
public function testAnonymous() {
$event = EntityTest::create();
$event
->save();
$parameters['entity_test'] = $event;
$account = new AnonymousUserSession();
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 anonymous access to: ' . $route_name);
}
}