You are here

protected function ResourceTypeRepositoryTest::setUp in JSON:API 8

Same name and namespace in other branches
  1. 8.2 tests/src/Kernel/ResourceType/ResourceTypeRepositoryTest.php \Drupal\Tests\jsonapi\Kernel\ResourceType\ResourceTypeRepositoryTest::setUp()

Overrides KernelTestBase::setUp

File

tests/src/Kernel/ResourceType/ResourceTypeRepositoryTest.php, line 39

Class

ResourceTypeRepositoryTest
@coversDefaultClass \Drupal\jsonapi\ResourceType\ResourceTypeRepository @group jsonapi @group legacy

Namespace

Drupal\Tests\jsonapi\Kernel\ResourceType

Code

protected function setUp() {
  parent::setUp();

  // Add the entity schemas.
  $this
    ->installEntitySchema('node');
  $this
    ->installEntitySchema('user');

  // Add the additional table schemas.
  $this
    ->installSchema('system', [
    'sequences',
  ]);
  $this
    ->installSchema('node', [
    'node_access',
  ]);
  $this
    ->installSchema('user', [
    'users_data',
  ]);
  NodeType::create([
    'type' => 'article',
  ])
    ->save();
  NodeType::create([
    'type' => 'page',
  ])
    ->save();
  $this->resourceTypeRepository = $this->container
    ->get('jsonapi.resource_type.repository');
}