You are here

public function KeyOverrideAdminTest::testOverrideUserRoutes in Key 8

Tests key routes for overriding key configuration.

File

tests/src/Functional/KeyOverrideAdminTest.php, line 39

Class

KeyOverrideAdminTest
Tests administration of key overrides.

Namespace

Drupal\Tests\key\Functional

Code

public function testOverrideUserRoutes() {
  $this
    ->drupalLogin($this->overrideUser);
  $basicKeyRoutes = [
    'entity.key.collection' => [],
    'entity.key.add_form' => [],
    'entity.key.edit_form' => [
      'key' => 'key_foo',
    ],
    'entity.key.delete_form' => [
      'key' => 'key_foo',
    ],
  ];
  $overrideKeyRoutes = [
    'entity.key_config_override.collection' => [],
    'entity.key_config_override.add_form' => [],
    'entity.key_config_override.delete_form' => [
      'key_config_override' => 'test_override',
    ],
  ];
  $this
    ->routeAccessTest($basicKeyRoutes, 403);
  $this
    ->routeAccessTest($overrideKeyRoutes, 200);
}