You are here

protected function RouteProviderTest::setUp in Drupal 10

Same name in this branch
  1. 10 core/tests/Drupal/KernelTests/Core/Routing/RouteProviderTest.php \Drupal\KernelTests\Core\Routing\RouteProviderTest::setUp()
  2. 10 core/tests/Drupal/KernelTests/Core/Entity/RouteProviderTest.php \Drupal\KernelTests\Core\Entity\RouteProviderTest::setUp()
Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Entity/RouteProviderTest.php \Drupal\KernelTests\Core\Entity\RouteProviderTest::setUp()
  2. 9 core/tests/Drupal/KernelTests/Core/Entity/RouteProviderTest.php \Drupal\KernelTests\Core\Entity\RouteProviderTest::setUp()

File

core/tests/Drupal/KernelTests/Core/Entity/RouteProviderTest.php, line 31

Class

RouteProviderTest
Tests route providers for entity types.

Namespace

Drupal\KernelTests\Core\Entity

Code

protected function setUp() : void {
  parent::setUp();
  $this
    ->setUpCurrentUser([
    'uid' => 1,
  ]);
  $this
    ->installEntitySchema('entity_test_mul');
  $this
    ->installEntitySchema('entity_test_admin_routes');

  /** @var \Drupal\user\RoleInterface $role */
  $role = Role::create([
    'id' => RoleInterface::ANONYMOUS_ID,
    'label' => 'Anonymous',
  ]);
  $role
    ->grantPermission('administer entity_test content')
    ->grantPermission('view test entity');
  $role
    ->save();
}