function AccessManagerTest::providerTestCheckConjunctions

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

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;
}

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