You are here

function AccessPermissionTest::testAccessPerm in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/user/src/Tests/Views/AccessPermissionTest.php \Drupal\user\Tests\Views\AccessPermissionTest::testAccessPerm()

Tests perm access plugin.

File

core/modules/user/src/Tests/Views/AccessPermissionTest.php, line 32
Contains \Drupal\user\Tests\Views\AccessPermissionTest.

Class

AccessPermissionTest
Tests views perm access plugin.

Namespace

Drupal\user\Tests\Views

Code

function testAccessPerm() {
  $view = Views::getView('test_access_perm');
  $view
    ->setDisplay();
  $access_plugin = $view->display_handler
    ->getPlugin('access');
  $this
    ->assertTrue($access_plugin instanceof Permission, 'Make sure the right class got instantiated.');
  $this
    ->assertEqual($access_plugin
    ->pluginTitle(), t('Permission'));
  $this
    ->assertFalse($view->display_handler
    ->access($this->webUser));
  $this
    ->assertTrue($view->display_handler
    ->access($this->normalUser));
}