diff core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.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/LocaleUpdateInterfaceTest.php	Thu Feb 28 13:21:36 2019 +0000
+++ b/core/modules/locale/tests/src/Functional/LocaleUpdateInterfaceTest.php	Thu May 09 15:33:08 2019 +0100
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\locale\Functional;
 
+use Drupal\Core\Url;
 use Drupal\Component\Render\FormattableMarkup;
 
 /**
@@ -40,7 +41,7 @@
     $this->assertNoText(t('Translation update status'), 'No status message');
 
     $this->drupalGet('admin/reports/translations');
-    $this->assertRaw(t('No translatable languages available. <a href=":add_language">Add a language</a> first.', [':add_language' => \Drupal::url('entity.configurable_language.collection')]), 'Language message');
+    $this->assertRaw(t('No translatable languages available. <a href=":add_language">Add a language</a> first.', [':add_language' => Url::fromRoute('entity.configurable_language.collection')->toString()]), 'Language message');
 
     // Add German language.
     $this->addLanguage('de');
@@ -65,7 +66,7 @@
     // Check if updates are available for German.
     $this->drupalGet('admin/reports/status');
     $this->assertText(t('Translation update status'), 'Status message');
-    $this->assertRaw(t('Updates available for: @languages. See the <a href=":updates">Available translation updates</a> page for more information.', ['@languages' => t('German'), ':updates' => \Drupal::url('locale.translate_status')]), 'Updates available message');
+    $this->assertRaw(t('Updates available for: @languages. See the <a href=":updates">Available translation updates</a> page for more information.', ['@languages' => t('German'), ':updates' => Url::fromRoute('locale.translate_status')->toString()]), 'Updates available message');
     $this->drupalGet('admin/reports/translations');
     $this->assertText(t('Updates for: @modules', ['@modules' => 'Locale test translate']), 'Translations available');
 
@@ -79,7 +80,7 @@
     // Check if no updates were found.
     $this->drupalGet('admin/reports/status');
     $this->assertText(t('Translation update status'), 'Status message');
-    $this->assertRaw(t('Missing translations for: @languages. See the <a href=":updates">Available translation updates</a> page for more information.', ['@languages' => t('German'), ':updates' => \Drupal::url('locale.translate_status')]), 'Missing translations message');
+    $this->assertRaw(t('Missing translations for: @languages. See the <a href=":updates">Available translation updates</a> page for more information.', ['@languages' => t('German'), ':updates' => Url::fromRoute('locale.translate_status')->toString()]), 'Missing translations message');
     $this->drupalGet('admin/reports/translations');
     $this->assertText(t('Missing translations for one project'), 'No translations found');
     $release_details = new FormattableMarkup('@module (@version). @info', [
@@ -111,7 +112,10 @@
     // Check if translations are available for Drupal core.
     $this->drupalGet('admin/reports/translations');
     $this->assertText(t('Updates for: @project', ['@project' => t('Drupal core')]), 'Translations found');
-    $this->assertText(new FormattableMarkup('@module (@date)', ['@module' => t('Drupal core'), '@date' => format_date(REQUEST_TIME, 'html_date')]), 'Core translation update');
+    $this->assertText(new FormattableMarkup('@module (@date)', [
+      '@module' => t('Drupal core'),
+      '@date' => $this->container->get('date.formatter')->format(REQUEST_TIME, 'html_date'),
+    ]), 'Core translation update');
     $update_button = $this->xpath('//input[@type="submit"][@value="' . t('Update translations') . '"]');
     $this->assertTrue($update_button, 'Update translations button');
   }