function EntityDefaultLanguageTest::setUp
Overrides KernelTestBase::setUp
File
- 
              core/modules/ language/ tests/ src/ Kernel/ EntityDefaultLanguageTest.php, line 33 
Class
- EntityDefaultLanguageTest
- Tests default language code is properly generated for entities.
Namespace
Drupal\Tests\language\KernelCode
protected function setUp() {
  parent::setUp();
  $this->installEntitySchema('user');
  // Activate Spanish language, so there are two languages activated.
  $language = $this->container
    ->get('entity_type.manager')
    ->getStorage('configurable_language')
    ->create([
    'id' => 'es',
  ]);
  $language->save();
  // Create a new content type which has Undefined language by default.
  $this->createContentType('ctund', LanguageInterface::LANGCODE_NOT_SPECIFIED);
  // Create a new content type which has Spanish language by default.
  $this->createContentType('ctes', 'es');
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
