function AccessPermissionTest::testAccessPerm
Same name in other branches
- 9 core/modules/user/tests/src/Kernel/Views/AccessPermissionTest.php \Drupal\Tests\user\Kernel\Views\AccessPermissionTest::testAccessPerm()
- 8.9.x core/modules/user/tests/src/Kernel/Views/AccessPermissionTest.php \Drupal\Tests\user\Kernel\Views\AccessPermissionTest::testAccessPerm()
- 11.x core/modules/user/tests/src/Kernel/Views/AccessPermissionTest.php \Drupal\Tests\user\Kernel\Views\AccessPermissionTest::testAccessPerm()
Tests perm access plugin.
File
-
core/
modules/ user/ tests/ src/ Kernel/ Views/ AccessPermissionTest.php, line 75
Class
- AccessPermissionTest
- Tests views perm access plugin.
Namespace
Drupal\Tests\user\Kernel\ViewsCode
public function testAccessPerm() : void {
$view = Views::getView('test_access_perm');
$view->setDisplay();
$access_plugin = $view->display_handler
->getPlugin('access');
$this->assertInstanceOf(Permission::class, $access_plugin);
$this->assertEquals('Permission', $access_plugin->pluginTitle());
$this->assertFalse($view->display_handler
->access($this->webUser));
$this->assertTrue($view->display_handler
->access($this->normalUser));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.