Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / node / tests / src / Functional / NodeTypeTranslationTest.php
index 07e61a036dd61998a33ff19f3c2ff524efa70f1e..973955c5dd97e131df10b32cf5c736766234ba7f 100644 (file)
@@ -2,7 +2,6 @@
 
 namespace Drupal\Tests\node\Functional;
 
-use Drupal\Component\Utility\Unicode;
 use Drupal\language\Entity\ConfigurableLanguage;
 use Drupal\Tests\BrowserTestBase;
 
@@ -83,6 +82,11 @@ class NodeTypeTranslationTest extends BrowserTestBase {
   protected function installParameters() {
     $parameters = parent::installParameters();
     $parameters['parameters']['langcode'] = $this->defaultLangcode;
+    // Create an empty po file so we don't attempt to download one from
+    // localize.drupal.org. It does not need to match the version exactly as the
+    // multi-lingual system will fallback.
+    \Drupal::service('file_system')->mkdir($this->publicFilesDirectory . '/translations', NULL, TRUE);
+    file_put_contents($this->publicFilesDirectory . "/translations/drupal-8.0.0.{$this->defaultLangcode}.po", '');
     return $parameters;
   }
 
@@ -90,7 +94,7 @@ class NodeTypeTranslationTest extends BrowserTestBase {
    * Tests the node type translation.
    */
   public function testNodeTypeTranslation() {
-    $type = Unicode::strtolower($this->randomMachineName(16));
+    $type = mb_strtolower($this->randomMachineName(16));
     $name = $this->randomString();
     $this->drupalLogin($this->adminUser);
     $this->drupalCreateContentType(['type' => $type, 'name' => $name]);
@@ -124,7 +128,7 @@ class NodeTypeTranslationTest extends BrowserTestBase {
    * Tests the node type title label translation.
    */
   public function testNodeTypeTitleLabelTranslation() {
-    $type = Unicode::strtolower($this->randomMachineName(16));
+    $type = mb_strtolower($this->randomMachineName(16));
     $name = $this->randomString();
     $this->drupalLogin($this->adminUser);
     $this->drupalCreateContentType(['type' => $type, 'name' => $name]);
@@ -154,7 +158,7 @@ class NodeTypeTranslationTest extends BrowserTestBase {
     $this->drupalPostForm(NULL, [], 'Save field settings');
     $this->drupalPostForm(NULL, [], 'Save settings');
 
-    $type = Unicode::strtolower($this->randomMachineName(16));
+    $type = mb_strtolower($this->randomMachineName(16));
     $name = $this->randomString();
     $this->drupalCreateContentType(['type' => $type, 'name' => $name]);