You are here

public function PermissionAccessCheckTest::providerTestAccess in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/user/tests/src/Unit/PermissionAccessCheckTest.php \Drupal\Tests\user\Unit\PermissionAccessCheckTest::providerTestAccess()

Provides data for the testAccess method.

Return value

array

File

core/modules/user/tests/src/Unit/PermissionAccessCheckTest.php, line 59
Contains \Drupal\Tests\user\Unit\PermissionAccessCheckTest.

Class

PermissionAccessCheckTest
@coversDefaultClass \Drupal\user\Access\PermissionAccessCheck @group Routing @group AccessF

Namespace

Drupal\Tests\user\Unit

Code

public function providerTestAccess() {
  return [
    [
      [],
      FALSE,
    ],
    [
      [
        '_permission' => 'allowed',
      ],
      TRUE,
      [
        'user.permissions',
      ],
    ],
    [
      [
        '_permission' => 'denied',
      ],
      FALSE,
      [
        'user.permissions',
      ],
    ],
    [
      [
        '_permission' => 'allowed+denied',
      ],
      TRUE,
      [
        'user.permissions',
      ],
    ],
    [
      [
        '_permission' => 'allowed+denied+other',
      ],
      TRUE,
      [
        'user.permissions',
      ],
    ],
    [
      [
        '_permission' => 'allowed,denied',
      ],
      FALSE,
      [
        'user.permissions',
      ],
    ],
  ];
}