You are here

function SupportTicketTestBase::assertSupportTicketAccess in Support Ticketing System 8

Asserts that support ticket access correctly grants or denies access.

Parameters

array $ops: An associative array of the expected support ticket access grants for the support ticket and account, with each key as the name of an operation (e.g. 'view', 'delete') and each value a Boolean indicating whether access to that operation should be granted.

\Drupal\support_ticket\Entity\SupportTicket $support_ticket: The support ticket object to check.

\Drupal\Core\Session\AccountInterface $account: The user account for which to check access.

1 call to SupportTicketTestBase::assertSupportTicketAccess()
SupportTicketAccessTest::testSupportTicketAccess in modules/support_ticket/src/Tests/SupportTicketAccessTest.php
Runs basic tests for support_ticket_access function.

File

modules/support_ticket/src/Tests/SupportTicketTestBase.php, line 93
Contains \Drupal\support_ticket\Tests\SupportTicketTestBase.

Class

SupportTicketTestBase
Sets up ticket type.

Namespace

Drupal\support_ticket\Tests

Code

function assertSupportTicketAccess(array $ops, $support_ticket, AccountInterface $account) {
  foreach ($ops as $op => $result) {
    $this
      ->assertEqual($result, $this->accessHandler
      ->access($support_ticket, $op, $account), $this
      ->supportTicketAccessAssertMessage($op, $result, $support_ticket
      ->language()
      ->getId()));
  }
}