function AccessPolicyProcessorTest::testMultipleScopeAlterException
Same name in other branches
- 10 core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php \Drupal\Tests\Core\Session\AccessPolicyProcessorTest::testMultipleScopeAlterException()
Tests the multiple scopes exception.
File
-
core/
tests/ Drupal/ Tests/ Core/ Session/ AccessPolicyProcessorTest.php, line 169
Class
- AccessPolicyProcessorTest
- Tests the AccessPolicyProcessor service.
Namespace
Drupal\Tests\Core\SessionCode
public function testMultipleScopeAlterException() : void {
$processor = $this->setUpAccessPolicyProcessor();
$processor->addAccessPolicy(new FooAccessPolicy());
$processor->addAccessPolicy(new AlwaysAltersAccessPolicy());
$this->expectException(AccessPolicyScopeException::class);
$this->expectExceptionMessage(sprintf('The access policy "%s" altered permissions in a scope other than "%s".', AlwaysAltersAccessPolicy::class, 'foo'));
$processor->processAccessPolicies($this->prophesize(AccountInterface::class)
->reveal(), 'foo');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.