diff --git a/core/modules/field/lib/Drupal/field/Tests/DisplayApiTest.php b/core/modules/field/lib/Drupal/field/Tests/DisplayApiTest.php index 3a31e00..d7353e5 100644 --- a/core/modules/field/lib/Drupal/field/Tests/DisplayApiTest.php +++ b/core/modules/field/lib/Drupal/field/Tests/DisplayApiTest.php @@ -149,7 +149,7 @@ function testFieldItemListView() { $setting = $display['settings']['test_formatter_setting_multiple']; $this->assertNoText($this->label, 'Label was not displayed.'); $this->assertText('field_test_entity_display_build_alter', 'Alter fired, display passed.'); - $this->assertText('entity language is ' . Language::LANGCODE_NOT_SPECIFIED, 'Language is placed onto the context.'); + $this->assertText('entity language is en', 'Language is placed onto the context.'); $array = array(); foreach ($this->values as $delta => $value) { $array[] = $delta . ':' . $value['value']; diff --git a/core/modules/field/lib/Drupal/field/Tests/FieldAttachOtherTest.php b/core/modules/field/lib/Drupal/field/Tests/FieldAttachOtherTest.php index 39f6e28..191a576 100644 --- a/core/modules/field/lib/Drupal/field/Tests/FieldAttachOtherTest.php +++ b/core/modules/field/lib/Drupal/field/Tests/FieldAttachOtherTest.php @@ -180,7 +180,7 @@ function testEntityDisplayViewMultiple() { function testFieldAttachCache() { // Initialize random values and a test entity. $entity_init = entity_create('entity_test', array('type' => $this->instance->bundle)); - $langcode = Language::LANGCODE_NOT_SPECIFIED; + $langcode = 'en'; $values = $this->_generateTestFieldValues($this->field->getCardinality()); // Non-cacheable entity type. diff --git a/core/modules/file/lib/Drupal/file/Tests/SaveTest.php b/core/modules/file/lib/Drupal/file/Tests/SaveTest.php index 50d6847..41f249e 100644 --- a/core/modules/file/lib/Drupal/file/Tests/SaveTest.php +++ b/core/modules/file/lib/Drupal/file/Tests/SaveTest.php @@ -46,12 +46,11 @@ function testFileSave() { $this->assertEqual($loaded_file->isPermanent(), $file->isPermanent(), 'Status was saved correctly.'); $this->assertEqual($file->getSize(), filesize($file->getFileUri()), 'File size was set correctly.', 'File'); $this->assertTrue($file->getChangedTime() > 1, 'File size was set correctly.', 'File'); - $this->assertEqual($loaded_file->langcode->value, Language::LANGCODE_NOT_SPECIFIED, 'Langcode was defaulted correctly.'); + $this->assertEqual($loaded_file->langcode->value, 'en', 'Langcode was defaulted correctly.'); // Resave the file, updating the existing record. file_test_reset(); $file->status->value = 7; - $file->langcode = 'en'; $file->save(); // Check that the correct hooks were called. diff --git a/core/modules/serialization/lib/Drupal/serialization/Tests/EntitySerializationTest.php b/core/modules/serialization/lib/Drupal/serialization/Tests/EntitySerializationTest.php index 865704d..fdd85a6 100644 --- a/core/modules/serialization/lib/Drupal/serialization/Tests/EntitySerializationTest.php +++ b/core/modules/serialization/lib/Drupal/serialization/Tests/EntitySerializationTest.php @@ -87,7 +87,7 @@ public function testNormalize() { array('value' => $this->entity->uuid()), ), 'langcode' => array( - array('value' => Language::LANGCODE_NOT_SPECIFIED), + array('value' => 'en'), ), 'default_langcode' => array( array('value' => NULL), @@ -143,7 +143,7 @@ public function testSerialize() { 'id' => '' . $this->entity->id() . '', 'revision_id' => '' . $this->entity->getRevisionId() . '', 'uuid' => '' . $this->entity->uuid() . '', - 'langcode' => '' . Language::LANGCODE_NOT_SPECIFIED . '', + 'langcode' => 'en', 'default_langcode' => '', 'name' => '' . $this->values['name'] . '', 'type' => 'entity_test_mulrev', diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldDefaultValueTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldDefaultValueTest.php index d624080..6ea6aeb 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldDefaultValueTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldDefaultValueTest.php @@ -55,7 +55,7 @@ public function testDefaultValues() { */ protected function assertDefaultValues($entity_type) { $entity = entity_create($entity_type); - $this->assertEqual($entity->langcode->value, Language::LANGCODE_NOT_SPECIFIED, String::format('%entity_type: Default language', array('%entity_type' => $entity_type))); + $this->assertEqual($entity->langcode->value, 'en', String::format('%entity_type: Default language', array('%entity_type' => $entity_type))); $this->assertTrue(Uuid::isValid($entity->uuid->value), String::format('%entity_type: Default UUID', array('%entity_type' => $entity_type))); $this->assertEqual($entity->name->getValue(), array(0 => array('value' => NULL)), 'Field has one empty value by default.'); } diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldTest.php index a838d2f..43e2b63 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldTest.php @@ -102,6 +102,8 @@ public function testReadWrite() { protected function assertReadWrite($entity_type) { $entity = $this->createTestEntity($entity_type); + $langcode = 'en'; + // Access the name field. $this->assertTrue($entity->name instanceof FieldItemListInterface, format_string('%entity_type: Field implements interface', array('%entity_type' => $entity_type))); $this->assertTrue($entity->name[0] instanceof FieldItemInterface, format_string('%entity_type: Field item implements interface', array('%entity_type' => $entity_type))); @@ -190,8 +192,8 @@ protected function assertReadWrite($entity_type) { $this->assertFalse(isset($entity->name->value), format_string('%entity_type: Name is not set.', array('%entity_type' => $entity_type))); // Access the language field. - $this->assertEqual(Language::LANGCODE_NOT_SPECIFIED, $entity->langcode->value, format_string('%entity_type: Language code can be read.', array('%entity_type' => $entity_type))); - $this->assertEqual(\Drupal::languageManager()->getLanguage(Language::LANGCODE_NOT_SPECIFIED), $entity->langcode->language, format_string('%entity_type: Language object can be read.', array('%entity_type' => $entity_type))); + $this->assertEqual($langcode, $entity->langcode->value, format_string('%entity_type: Language code can be read.', array('%entity_type' => $entity_type))); + $this->assertEqual(\Drupal::languageManager()->getLanguage($langcode), $entity->langcode->language, format_string('%entity_type: Language object can be read.', array('%entity_type' => $entity_type))); // Change the language by code. $entity->langcode->value = \Drupal::languageManager()->getDefaultLanguage()->id; @@ -199,7 +201,7 @@ protected function assertReadWrite($entity_type) { $this->assertEqual(\Drupal::languageManager()->getDefaultLanguage(), $entity->langcode->language, format_string('%entity_type: Language object can be read.', array('%entity_type' => $entity_type))); // Revert language by code then try setting it by language object. - $entity->langcode->value = Language::LANGCODE_NOT_SPECIFIED; + $entity->langcode->value = $langcode; $entity->langcode->language = \Drupal::languageManager()->getDefaultLanguage(); $this->assertEqual(\Drupal::languageManager()->getDefaultLanguage()->id, $entity->langcode->value, format_string('%entity_type: Language code can be read.', array('%entity_type' => $entity_type))); $this->assertEqual(\Drupal::languageManager()->getDefaultLanguage(), $entity->langcode->language, format_string('%entity_type: Language object can be read.', array('%entity_type' => $entity_type))); @@ -329,8 +331,8 @@ protected function assertSave($entity_type) { // Access the name field. $this->assertEqual(1, $entity->id->value, format_string('%entity_type: ID value can be read.', array('%entity_type' => $entity_type))); $this->assertTrue(is_string($entity->uuid->value), format_string('%entity_type: UUID value can be read.', array('%entity_type' => $entity_type))); - $this->assertEqual(Language::LANGCODE_NOT_SPECIFIED, $entity->langcode->value, format_string('%entity_type: Language code can be read.', array('%entity_type' => $entity_type))); - $this->assertEqual(\Drupal::languageManager()->getLanguage(Language::LANGCODE_NOT_SPECIFIED), $entity->langcode->language, format_string('%entity_type: Language object can be read.', array('%entity_type' => $entity_type))); + $this->assertEqual('en', $entity->langcode->value, format_string('%entity_type: Language code can be read.', array('%entity_type' => $entity_type))); + $this->assertEqual(\Drupal::languageManager()->getLanguage('en'), $entity->langcode->language, format_string('%entity_type: Language object can be read.', array('%entity_type' => $entity_type))); $this->assertEqual($this->entity_user->id(), $entity->user_id->target_id, format_string('%entity_type: User id can be read.', array('%entity_type' => $entity_type))); $this->assertEqual($this->entity_user->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: User name can be read.', array('%entity_type' => $entity_type))); $this->assertEqual($this->entity_field_text, $entity->field_test_text->value, format_string('%entity_type: Text field can be read.', array('%entity_type' => $entity_type))); @@ -504,7 +506,7 @@ protected function assertDataStructureInterfaces($entity_type) { // the user name and other user entity strings as well. $target_strings = array( $entity->uuid->value, - Language::LANGCODE_NOT_SPECIFIED, + 'en', $this->entity_name, // Bundle name. $entity->bundle(), diff --git a/core/modules/text/lib/Drupal/text/Tests/TextWithSummaryItemTest.php b/core/modules/text/lib/Drupal/text/Tests/TextWithSummaryItemTest.php index 9b93095..787ec88 100644 --- a/core/modules/text/lib/Drupal/text/Tests/TextWithSummaryItemTest.php +++ b/core/modules/text/lib/Drupal/text/Tests/TextWithSummaryItemTest.php @@ -128,7 +128,7 @@ function testProcessedCache() { $entity = entity_load($entity_type, $entity->id()); $cache = \Drupal::cache('entity')->get("field:$entity_type:" . $entity->id()); $this->assertEqual($cache->data, array( - Language::LANGCODE_NOT_SPECIFIED => array( + 'en' => array( 'summary_field' => array( 0 => array( 'value' => $value, @@ -144,7 +144,7 @@ function testProcessedCache() { // Inject fake processed values into the cache to make sure that these are // used as-is and not re-calculated when the entity is loaded. $data = array( - Language::LANGCODE_NOT_SPECIFIED => array( + 'en' => array( 'summary_field' => array( 0 => array( 'value' => $value,