You are here

protected function ViewsAccessTest::checkAccess in Entity Print 8.2

Checks access for the user to print the view.

Parameters

\Drupal\Core\Session\AccountInterface $account: The account we're checking against.

string $view_name: The view name.

string $display_id: The view display.

Return value

bool TRUE if the user has access otherwise FALSE.

1 call to ViewsAccessTest::checkAccess()
ViewsAccessTest::testEntityPrintAccess in modules/entity_print_views/tests/src/Kernel/ViewsAccessTest.php
Test the access works for viewing the PDF's.

File

modules/entity_print_views/tests/src/Kernel/ViewsAccessTest.php, line 80

Class

ViewsAccessTest
Views access test.

Namespace

Drupal\Tests\entity_print_views\Kernel

Code

protected function checkAccess(AccountInterface $account, $view_name, $display_id) {
  $this->container
    ->get('current_user')
    ->setAccount($account);
  $controller = ViewPrintController::create($this->container);
  return $controller
    ->checkAccess('pdf', $view_name, $display_id)
    ->isAllowed();
}