You are here

public function DomainAccessPermissionsTest::assertNodeAccess in Domain Access 8

Asserts that node access correctly grants or denies access.

Parameters

array $ops: An associative array of the expected node access grants for the node 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\node\NodeInterface $node: The node object to check.

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

1 call to DomainAccessPermissionsTest::assertNodeAccess()
DomainAccessPermissionsTest::testDomainAccessPermissions in domain_access/tests/src/Functional/DomainAccessPermissionsTest.php
Runs basic tests for node_access function.

File

domain_access/tests/src/Functional/DomainAccessPermissionsTest.php, line 295

Class

DomainAccessPermissionsTest
Tests the domain access integration with node_access callbacks.

Namespace

Drupal\Tests\domain_access\Functional

Code

public function assertNodeAccess(array $ops, NodeInterface $node, AccountInterface $account) {
  foreach ($ops as $op => $result) {
    $this
      ->assertEqual($result, $this->accessHandler
      ->access($node, $op, $account), 'Expected result returned.');
  }
}