You are here

public function UserSessionTest::providerTestHasPermission in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Session/UserSessionTest.php \Drupal\Tests\Core\Session\UserSessionTest::providerTestHasPermission()
  2. 9 core/tests/Drupal/Tests/Core/Session/UserSessionTest.php \Drupal\Tests\Core\Session\UserSessionTest::providerTestHasPermission()

Provides test data for getHasPermission().

Return value

array

File

core/tests/Drupal/Tests/Core/Session/UserSessionTest.php, line 29

Class

UserSessionTest
@coversDefaultClass \Drupal\Core\Session\UserSession @group Session

Namespace

Drupal\Tests\Core\Session

Code

public function providerTestHasPermission() {
  $data = [];
  $data[] = [
    'example permission',
    [
      'user_one',
      'user_two',
    ],
    [
      'user_last',
    ],
  ];
  $data[] = [
    'another example permission',
    [
      'user_two',
    ],
    [
      'user_one',
      'user_last',
    ],
  ];
  $data[] = [
    'final example permission',
    [],
    [
      'user_one',
      'user_two',
      'user_last',
    ],
  ];
  return $data;
}