You are here

protected function JsonApiFunctionalMultilingualTest::setUp in JSON:API 8

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

Overrides JsonApiFunctionalTestBase::setUp

File

tests/src/Functional/JsonApiFunctionalMultilingualTest.php, line 32

Class

JsonApiFunctionalMultilingualTest
Tests JSON API multilingual support.

Namespace

Drupal\Tests\jsonapi\Functional

Code

protected function setUp() {
  parent::setUp();
  $language = ConfigurableLanguage::createFromLangcode('ca');
  $language
    ->save();

  // In order to reflect the changes for a multilingual site in the container
  // we have to rebuild it.
  $this
    ->rebuildContainer();
  \Drupal::configFactory()
    ->getEditable('language.negotiation')
    ->set('url.prefixes.ca', 'ca')
    ->save();
}