You are here

public function ConfigurableLanguageResourceTestBase::testGetDefaultConfig in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/language/tests/src/Functional/Rest/ConfigurableLanguageResourceTestBase.php \Drupal\Tests\language\Functional\Rest\ConfigurableLanguageResourceTestBase::testGetDefaultConfig()
  2. 10 core/modules/language/tests/src/Functional/Rest/ConfigurableLanguageResourceTestBase.php \Drupal\Tests\language\Functional\Rest\ConfigurableLanguageResourceTestBase::testGetDefaultConfig()

Test a GET request for a default config entity, which has a _core key.

See also

https://www.drupal.org/node/2915414

File

core/modules/language/tests/src/Functional/Rest/ConfigurableLanguageResourceTestBase.php, line 83

Class

ConfigurableLanguageResourceTestBase

Namespace

Drupal\Tests\language\Functional\Rest

Code

public function testGetDefaultConfig() {
  $this
    ->initAuthentication();
  $url = Url::fromUri('base:/entity/configurable_language/en')
    ->setOption('query', [
    '_format' => static::$format,
  ]);
  $request_options = $this
    ->getAuthenticationRequestOptions('GET');
  $this
    ->provisionEntityResource();
  $this
    ->setUpAuthorization('GET');
  $response = $this
    ->request('GET', $url, $request_options);
  $normalization = $this->serializer
    ->decode((string) $response
    ->getBody(), static::$format);
  $this
    ->assertArrayNotHasKey('_core', $normalization);
}