public function ConfigurableLanguageResourceTestBase::testGetDefaultConfig in Drupal 9
Same name and namespace in other branches
- 8 core/modules/language/tests/src/Functional/Rest/ConfigurableLanguageResourceTestBase.php \Drupal\Tests\language\Functional\Rest\ConfigurableLanguageResourceTestBase::testGetDefaultConfig()
Tests 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
Namespace
Drupal\Tests\language\Functional\RestCode
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);
}