function AccessManagerTest::providerTestCheckConjunctions

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php \Drupal\Tests\Core\Access\AccessManagerTest::providerTestCheckConjunctions()
  2. 8.9.x core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php \Drupal\Tests\Core\Access\AccessManagerTest::providerTestCheckConjunctions()
  3. 10 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 251

Class

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

Namespace

Drupal\Tests\Core\Access

Code

public static 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' => $access_kill,
    ];
    $access_configurations[] = [
        'name' => 'test_route_5',
        'condition_one' => 'TRUE',
        'condition_two' => 'NULL',
        'expected_access' => $access_deny,
    ];
    $access_configurations[] = [
        'name' => 'test_route_6',
        'condition_one' => 'FALSE',
        'condition_two' => 'NULL',
        'expected_access' => $access_kill,
    ];
    $access_configurations[] = [
        'name' => 'test_route_7',
        'condition_one' => 'TRUE',
        'condition_two' => 'TRUE',
        'expected_access' => $access_allow,
    ];
    $access_configurations[] = [
        'name' => 'test_route_8',
        'condition_one' => 'FALSE',
        'condition_two' => 'FALSE',
        'expected_access' => $access_kill,
    ];
    $access_configurations[] = [
        'name' => 'test_route_9',
        'condition_one' => 'NULL',
        'condition_two' => 'NULL',
        'expected_access' => $access_deny,
    ];
    return $access_configurations;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.