diff --git a/core/modules/language/tests/src/EntityDefaultLanguageTest.php b/core/modules/language/tests/src/EntityDefaultLanguageTest.php index 0b2a3ca..c7ec49c 100644 --- a/core/modules/language/tests/src/EntityDefaultLanguageTest.php +++ b/core/modules/language/tests/src/EntityDefaultLanguageTest.php @@ -7,20 +7,20 @@ namespace Drupal\language\Tests; -use Drupal\Core\Language\Language; -use Drupal\simpletest\DrupalUnitTestBase; +use Drupal\Core\Language\LanguageInterface; +use Drupal\simpletest\KernelTestBase; /** * Tests default language code is properly generated for entities. */ -class EntityDefaultLanguageTest extends DrupalUnitTestBase { +class EntityDefaultLanguageTest extends KernelTestBase { /** * Modules to enable. * * @var array */ - public static $modules = array('language', 'node', 'field', 'text'); + public static $modules = array('language', 'node', 'field', 'text', 'user'); /** * {@inheritdoc} @@ -46,7 +46,7 @@ public function setUp() { $language_entity->save(); // Create a new content type which has Undefined language by default. - $this->createContentType('ctund', Language::LANGCODE_NOT_SPECIFIED); + $this->createContentType('ctund', LanguageInterface::LANGCODE_NOT_SPECIFIED); // Create a new content type which has Spanish language by default. $this->createContentType('ctes', 'es'); } @@ -59,7 +59,7 @@ public function testEntityTranslationDefaultLanguageViaCode() { // have no language by default, a new node of this content type will have // "und" language code when language is not specified. $node = $this->createNode('ctund'); - $this->assertEqual($node->langcode->value, Language::LANGCODE_NOT_SPECIFIED); + $this->assertEqual($node->langcode->value, LanguageInterface::LANGCODE_NOT_SPECIFIED); // With language module activated, and a content type that is configured to // have no language by default, a new node of this content type will have // "es" language code when language is specified as "es". @@ -82,9 +82,9 @@ public function testEntityTranslationDefaultLanguageViaCode() { // With language module disabled, and a content type that is configured to // have no language specified by default, a new node of this content type - // will have "und" language code when language is not specified. + // will have site's default language code when language is not specified. $node = $this->createNode('ctund'); - $this->assertEqual($node->langcode->value, Language::LANGCODE_NOT_SPECIFIED); + $this->assertEqual($node->langcode->value, 'en'); // With language module disabled, and a content type that is configured to // have no language specified by default, a new node of this type will have // "es" language code when language "es" is specified. @@ -92,10 +92,10 @@ public function testEntityTranslationDefaultLanguageViaCode() { $this->assertEqual($node->langcode->value, 'es'); // With language module disabled, and a content type that is configured to - // have language "es" by default, a new node of this type will have "und" - // language code when language is not specified. + // have language "es" by default, a new node of this type will have site's + // default language code when language is not specified. $node = $this->createNode('ctes'); - $this->assertEqual($node->langcode->value, Language::LANGCODE_NOT_SPECIFIED); + $this->assertEqual($node->langcode->value, 'en'); // With language module disabled, and a content type that is configured to // have language "es" by default, a new node of this type will have "en" // language code when language "en" is specified. @@ -139,7 +139,7 @@ protected function createContentType($name, $langcode) { protected function createNode($type, $langcode = NULL) { $values = array( 'type' => $type, - 'title' => $this->randomName(), + 'title' => $this->randomString(), ); if (!empty($langcode)) { $values['langcode'] = $langcode;