public function RngEventAccessTest::testAllAccess in RNG - Events and Registrations 3.x
Same name and namespace in other branches
- 8.2 tests/src/Kernel/RngEventAccessTest.php \Drupal\Tests\rng\Kernel\RngEventAccessTest::testAllAccess()
- 8 tests/src/Kernel/RngEventAccessTest.php \Drupal\Tests\rng\Kernel\RngEventAccessTest::testAllAccess()
Test user role with access to administer all entities.
File
- tests/
src/ Kernel/ RngEventAccessTest.php, line 96
Class
- RngEventAccessTest
- Tests manage event access control. to register for events..
Namespace
Drupal\Tests\rng\KernelCode
public function testAllAccess() {
$event = EntityTest::create();
$event
->save();
$parameters['entity_test'] = $event;
// 'administer entity_test content' grants update to entitytest entities.
$account = $this
->drupalCreateUser([
'administer entity_test content',
]);
foreach ($this->routes as $route_name) {
$route = $this->routeProvider
->getRouteByName($route_name);
$route_match = new RouteMatch($route_name, $route, $parameters);
$this
->assertTrue($this->accessManager
->check($route_match, $account), 'All access to: ' . $route_name);
}
}