You are here

public function AccessTest::accessTestDataProvider in Search API Autocomplete 8

Provides test data for the testAccess() method.

Return value

array An array containing arrays of method arguments for testAccess().

See also

\Drupal\Tests\search_api_autocomplete\Unit\AccessTest::testAccess

File

tests/src/Unit/AccessTest.php, line 134

Class

AccessTest
Tests access to the autocomplete path.

Namespace

Drupal\Tests\search_api_autocomplete\Unit

Code

public function accessTestDataProvider() {
  return [
    'search disabled' => [
      [
        'status' => FALSE,
      ],
      FALSE,
    ],
    'index does not exist' => [
      [
        'index' => FALSE,
      ],
      FALSE,
    ],
    'index disabled' => [
      [
        'index_status' => FALSE,
      ],
      FALSE,
    ],
    'search-specific permission missing' => [
      [
        'permission' => FALSE,
        'admin' => FALSE,
      ],
      FALSE,
    ],
    'search-specific permission present' => [
      [
        'admin' => FALSE,
      ],
      TRUE,
    ],
    'is admin' => [
      [
        'permission' => FALSE,
      ],
      TRUE,
    ],
  ];
}