You are here

public function AccessManagerTest::providerTestCheckConjunctions in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php \Drupal\Tests\Core\Access\AccessManagerTest::providerTestCheckConjunctions()

Provides data for the conjunction test.

Return value

array An array of data for check conjunctions.

See also

\Drupal\Tests\Core\Access\AccessManagerTest::testCheckConjunctions()

File

core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php, line 255
Contains \Drupal\Tests\Core\Access\AccessManagerTest.

Class

AccessManagerTest
@coversDefaultClass \Drupal\Core\Access\AccessManager @group Access

Namespace

Drupal\Tests\Core\Access

Code

public function providerTestCheckConjunctions() {
  $access_allow = AccessResult::allowed();
  $access_deny = AccessResult::neutral();
  $access_kill = AccessResult::forbidden();
  $access_configurations = [];
  $access_configurations[] = [
    'name' => 'test_route_4',
    'condition_one' => 'TRUE',
    'condition_two' => 'FALSE',
    'expected' => $access_kill,
  ];
  $access_configurations[] = [
    'name' => 'test_route_5',
    'condition_one' => 'TRUE',
    'condition_two' => 'NULL',
    'expected' => $access_deny,
  ];
  $access_configurations[] = [
    'name' => 'test_route_6',
    'condition_one' => 'FALSE',
    'condition_two' => 'NULL',
    'expected' => $access_kill,
  ];
  $access_configurations[] = [
    'name' => 'test_route_7',
    'condition_one' => 'TRUE',
    'condition_two' => 'TRUE',
    'expected' => $access_allow,
  ];
  $access_configurations[] = [
    'name' => 'test_route_8',
    'condition_one' => 'FALSE',
    'condition_two' => 'FALSE',
    'expected' => $access_kill,
  ];
  $access_configurations[] = [
    'name' => 'test_route_9',
    'condition_one' => 'NULL',
    'condition_two' => 'NULL',
    'expected' => $access_deny,
  ];
  return $access_configurations;
}