function AccessManagerTest::testSetChecks
Same name in other branches
- 8.9.x core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php \Drupal\Tests\Core\Access\AccessManagerTest::testSetChecks()
- 10 core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php \Drupal\Tests\Core\Access\AccessManagerTest::testSetChecks()
- 11.x core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php \Drupal\Tests\Core\Access\AccessManagerTest::testSetChecks()
Tests \Drupal\Core\Access\AccessManager::setChecks().
File
-
core/
tests/ Drupal/ Tests/ Core/ Access/ AccessManagerTest.php, line 139
Class
- AccessManagerTest
- @coversDefaultClass \Drupal\Core\Access\AccessManager @group Access
Namespace
Drupal\Tests\Core\AccessCode
public function testSetChecks() {
// Check setChecks without any access checker defined yet.
$this->checkProvider
->setChecks($this->routeCollection);
foreach ($this->routeCollection
->all() as $route) {
$this->assertNull($route->getOption('_access_checks'));
}
$this->setupAccessChecker();
$this->checkProvider
->setChecks($this->routeCollection);
$this->assertNull($this->routeCollection
->get('test_route_1')
->getOption('_access_checks'));
$this->assertEquals([
'test_access_default',
], $this->routeCollection
->get('test_route_2')
->getOption('_access_checks'));
$this->assertEquals([
'test_access_default',
], $this->routeCollection
->get('test_route_3')
->getOption('_access_checks'));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.