function ConfigurableLanguageResourceTestBase::testGetDefaultConfig

Same name in other branches
  1. 8.9.x 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()
  3. 11.x 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 84

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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.