Update to Drupal 8.0.0. For more information, see https://www.drupal.org/node/2619030
This commit is contained in:
parent
7784f4c23d
commit
25a6735fb3
49 changed files with 1394 additions and 281 deletions
|
@ -328,6 +328,7 @@ class EntityTranslationTest extends EntityLanguageTestBase {
|
|||
// Verify that we obtain the entity object itself when we attempt to
|
||||
// retrieve a translation referring to it.
|
||||
$translation = $entity->getTranslation(LanguageInterface::LANGCODE_NOT_SPECIFIED);
|
||||
$this->assertFalse($translation->isNewTranslation(), 'Existing translations are not marked as new.');
|
||||
$this->assertIdentical($entity, $translation, 'The translation object corresponding to a non-default language is the entity object itself when the entity is language-neutral.');
|
||||
$entity->{$langcode_key}->value = $default_langcode;
|
||||
$translation = $entity->getTranslation($default_langcode);
|
||||
|
@ -353,6 +354,7 @@ class EntityTranslationTest extends EntityLanguageTestBase {
|
|||
$entity->name->value = $name;
|
||||
$name_translated = $langcode . '_' . $this->randomMachineName();
|
||||
$translation = $entity->addTranslation($langcode);
|
||||
$this->assertTrue($translation->isNewTranslation(), 'Newly added translations are marked as new.');
|
||||
$this->assertNotIdentical($entity, $translation, 'The entity and the translation object differ from one another.');
|
||||
$this->assertTrue($entity->hasTranslation($langcode), 'The new translation exists.');
|
||||
$this->assertEqual($translation->language()->getId(), $langcode, 'The translation language matches the specified one.');
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
function keyvalue_test_entity_type_alter(array &$entity_types) {
|
||||
/** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
|
||||
if (isset($entity_types['entity_test_label'])) {
|
||||
$entity_types['entity_test_label']->setStorageClass('Drupal\Core\Entity\KeyValueStore\KeyValueEntityStorage');
|
||||
$entity_types['entity_test_label']->setStorageClass('Drupal\Core\Entity\KeyValueStore\KeyValueContentEntityStorage');
|
||||
$entity_keys = $entity_types['entity_test_label']->getKeys();
|
||||
$entity_types['entity_test_label']->set('entity_keys', $entity_keys + array('uuid' => 'uuid'));
|
||||
}
|
||||
|
|
Reference in a new issue