diff core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents a9cd425dd02b
children
line wrap: on
line diff
--- a/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php	Thu Feb 28 13:11:55 2019 +0000
+++ b/core/modules/locale/tests/src/Functional/LocaleTranslationUiTest.php	Thu May 09 15:34:47 2019 +0100
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\locale\Functional;
 
+use Drupal\Core\Url;
+use Drupal\Core\Database\Database;
 use Drupal\language\Entity\ConfigurableLanguage;
 use Drupal\Tests\BrowserTestBase;
 use Drupal\Core\Language\LanguageInterface;
@@ -96,7 +98,7 @@
     $this->drupalPostForm('admin/config/regional/translate', $edit, t('Save translations'));
     $this->assertText(t('The strings have been saved.'), 'The strings have been saved.');
     $url_bits = explode('?', $this->getUrl());
-    $this->assertEqual($url_bits[0], \Drupal::url('locale.translate_page', [], ['absolute' => TRUE]), 'Correct page redirection.');
+    $this->assertEqual($url_bits[0], Url::fromRoute('locale.translate_page', [], ['absolute' => TRUE])->toString(), 'Correct page redirection.');
     $search = [
       'string' => $name,
       'langcode' => $langcode,
@@ -232,7 +234,7 @@
 
     // Retrieve the source string of the first string available in the
     // {locales_source} table and translate it.
-    $query = db_select('locales_source', 's');
+    $query = Database::getConnection()->select('locales_source', 's');
     $query->addJoin('INNER', 'locales_location', 'l', 's.lid = l.lid');
     $source = $query->fields('s', ['source'])
       ->condition('l.type', 'javascript')
@@ -262,7 +264,7 @@
     $this->assertTrue($result = file_exists($js_file), new FormattableMarkup('JavaScript file created: %file', ['%file' => $result ? $js_file : 'not found']));
 
     // Test JavaScript translation rebuilding.
-    file_unmanaged_delete($js_file);
+    \Drupal::service('file_system')->delete($js_file);
     $this->assertTrue($result = !file_exists($js_file), new FormattableMarkup('JavaScript file deleted: %file', ['%file' => $result ? $js_file : 'found']));
     _locale_rebuild_js($langcode);
     $this->assertTrue($result = file_exists($js_file), new FormattableMarkup('JavaScript file rebuilt: %file', ['%file' => $result ? $js_file : 'not found']));