You are here

protected function LinkProviderTest::setUp in JSON:API Hypermedia 8

Overrides BrowserTestBase::setUp

File

tests/src/Functional/LinkProviderTest.php, line 68

Class

LinkProviderTest
Class LinkProviderTest.

Namespace

Drupal\Tests\jsonapi_hypermedia\Functional

Code

protected function setUp() {
  parent::setUp();
  NodeType::create([
    'type' => 'article',
    'name' => 'Article',
  ])
    ->save();
  $node = Node::create([
    'type' => 'article',
    'title' => 'Test Node',
  ]);
  $node
    ->save();
  $this->uris = [
    'entrypoint' => 'base:/jsonapi',
    'error' => 'base:/jsonapi/node/article/missing',
    'individual' => "base:/jsonapi/node/article/{$node->uuid()}",
    'collection' => 'base:/jsonapi/node/article',
    'relationship' => "base:/jsonapi/node/article/{$node->uuid()}/relationships/uid",
  ];
  $this->linkManager = $this->container
    ->get('jsonapi_hypermedia_provider.manager');
  $this->state = $this->container
    ->get('state');
  $this->account = $this
    ->createUser();
  $this->container
    ->set('current_user', $this->account);
}