You are here

protected function ApiTest::setUp in Lightning API 8

Same name and namespace in other branches
  1. 8.2 modules/api_test/tests/src/Functional/ApiTest.php \Drupal\Tests\api_test\Functional\ApiTest::setUp()

Overrides ApiTestBase::setUp

File

modules/api_test/tests/src/Functional/ApiTest.php, line 29

Class

ApiTest
Tests that OAuth and json:api are working together to authenticate, authorize and allow/forbid interaction with entities as designed.

Namespace

Drupal\Tests\api_test\Functional

Code

protected function setUp() {
  parent::setUp();
  $page_creator_client_options = [
    'form_params' => [
      'grant_type' => 'password',
      'client_id' => 'api_test-oauth2-client',
      'client_secret' => 'oursecret',
      'username' => 'api-test-user',
      'password' => 'admin',
    ],
  ];
  $this->token = $this
    ->getToken($page_creator_client_options);
}