You are here

protected function LanguageTest::setUp in GraphQL 8.3

Overrides GraphQLCoreTestBase::setUp

File

modules/graphql_core/tests/src/Kernel/Languages/LanguageTest.php, line 25

Class

LanguageTest
Test multilingual behavior.

Namespace

Drupal\Tests\graphql_core\Kernel\Languages

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installConfig([
    'language',
  ]);
  $this
    ->installEntitySchema('configurable_language');
  $this->container
    ->get('router.builder')
    ->rebuild();
  ConfigurableLanguage::create([
    'id' => 'es',
    'weight' => 2,
  ])
    ->save();
  ConfigurableLanguage::create([
    'id' => 'pt-br',
    'weight' => 3,
  ])
    ->save();
  $config = $this
    ->config('language.negotiation');
  $config
    ->set('url.prefixes', [
    'en' => 'en',
    'es' => 'es',
    'fr' => 'fr',
  ])
    ->save();
  $this->container
    ->get('kernel')
    ->rebuildContainer();
}