You are here

public function ContentLanguageSettingsUnitTest::providerIsDefaultConfiguration in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/language/tests/src/Unit/ContentLanguageSettingsUnitTest.php \Drupal\Tests\language\Unit\ContentLanguageSettingsUnitTest::providerIsDefaultConfiguration()

File

core/modules/language/tests/src/Unit/ContentLanguageSettingsUnitTest.php, line 215
Contains \Drupal\Tests\language\Unit\ContentLanguageSettingsUnitTest.

Class

ContentLanguageSettingsUnitTest
@coversDefaultClass \Drupal\language\Entity\ContentLanguageSettings @group language

Namespace

Drupal\Tests\language\Unit

Code

public function providerIsDefaultConfiguration() {
  $alteredLanguage = new ContentLanguageSettings(array(
    'target_entity_type_id' => 'test_entity_type',
    'target_bundle' => 'test_bundle',
  ), 'language_content_settings');
  $alteredLanguage
    ->setLanguageAlterable(true);
  $alteredDefaultLangcode = new ContentLanguageSettings(array(
    'target_entity_type_id' => 'test_entity_type',
    'target_bundle' => 'test_fixed_language_bundle',
  ), 'language_content_settings');
  $alteredDefaultLangcode
    ->setDefaultLangcode($this
    ->randomMachineName());
  $defaultConfig = new ContentLanguageSettings(array(
    'target_entity_type_id' => 'test_entity_type',
    'target_bundle' => 'test_default_language_bundle',
  ), 'language_content_settings');
  return [
    [
      $alteredLanguage,
      false,
    ],
    [
      $alteredDefaultLangcode,
      false,
    ],
    [
      $defaultConfig,
      true,
    ],
  ];
}