diff core/modules/locale/tests/src/Functional/LocaleUpdateBase.php @ 18:af1871eacc83

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:33:08 +0100
parents 129ea1e6d783
children
line wrap: on
line diff
--- a/core/modules/locale/tests/src/Functional/LocaleUpdateBase.php	Thu Feb 28 13:21:36 2019 +0000
+++ b/core/modules/locale/tests/src/Functional/LocaleUpdateBase.php	Thu May 09 15:33:08 2019 +0100
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\locale\Functional;
 
+use Drupal\Core\Database\Database;
+use Drupal\Core\File\FileSystemInterface;
 use Drupal\Core\StreamWrapper\PublicStream;
 use Drupal\file\Entity\File;
 use Drupal\Tests\BrowserTestBase;
@@ -75,7 +77,7 @@
    *   directory.
    */
   protected function setTranslationsDirectory($path) {
-    file_prepare_directory($path, FILE_CREATE_DIRECTORY);
+    \Drupal::service('file_system')->prepareDirectory($path, FileSystemInterface::CREATE_DIRECTORY);
     $this->config('locale.settings')->set('translation.path', $path)->save();
   }
 
@@ -129,7 +131,7 @@
       }
     }
 
-    file_prepare_directory($path, FILE_CREATE_DIRECTORY);
+    \Drupal::service('file_system')->prepareDirectory($path, FileSystemInterface::CREATE_DIRECTORY);
     $file = File::create([
       'uid' => 1,
       'filename' => $filename,
@@ -278,9 +280,10 @@
       'filename' => 'custom_module_one.de.po',
       'version' => '',
     ];
+    $connection = Database::getConnection();
     foreach ($data as $file) {
       $file = array_merge($default, $file);
-      db_insert('locale_file')->fields($file)->execute();
+      $connection->insert('locale_file')->fields($file)->execute();
     }
   }