diff core/modules/language/tests/src/Functional/LanguageCustomLanguageConfigurationTest.php @ 18:af1871eacc83

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:33:08 +0100
parents 4c8ae668cc8c
children
line wrap: on
line diff
--- a/core/modules/language/tests/src/Functional/LanguageCustomLanguageConfigurationTest.php	Thu Feb 28 13:21:36 2019 +0000
+++ b/core/modules/language/tests/src/Functional/LanguageCustomLanguageConfigurationTest.php	Thu May 09 15:33:08 2019 +0100
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\language\Functional;
 
+use Drupal\Core\Url;
 use Drupal\Core\Language\Language;
 use Drupal\Core\Language\LanguageInterface;
 use Drupal\Tests\BrowserTestBase;
@@ -39,7 +40,7 @@
     $this->assertText(t('@name field is required.', ['@name' => t('Language name')]));
     $empty_language = new Language();
     $this->assertFieldChecked('edit-direction-' . $empty_language->getDirection(), 'Consistent usage of language direction.');
-    $this->assertUrl(\Drupal::url('language.add', [], ['absolute' => TRUE]), [], 'Correct page redirection.');
+    $this->assertUrl(Url::fromRoute('language.add', [], ['absolute' => TRUE])->toString(), [], 'Correct page redirection.');
 
     // Test validation of invalid values.
     $edit = [
@@ -56,7 +57,7 @@
     ]));
 
     $this->assertRaw(t('%field cannot contain any markup.', ['%field' => t('Language name')]));
-    $this->assertUrl(\Drupal::url('language.add', [], ['absolute' => TRUE]), [], 'Correct page redirection.');
+    $this->assertUrl(Url::fromRoute('language.add', [], ['absolute' => TRUE])->toString(), [], 'Correct page redirection.');
 
     // Test adding a custom language with a numeric region code.
     $edit = [
@@ -71,7 +72,7 @@
       'The language %language has been created and can now be used.',
       ['%language' => $edit['label']]
     ));
-    $this->assertUrl(\Drupal::url('entity.configurable_language.collection', [], ['absolute' => TRUE]), [], 'Correct page redirection.');
+    $this->assertUrl(Url::fromRoute('entity.configurable_language.collection', [], ['absolute' => TRUE])->toString(), [], 'Correct page redirection.');
 
     // Test validation of existing language values.
     $edit = [
@@ -87,7 +88,7 @@
       'The language %language has been created and can now be used.',
       ['%language' => $edit['label']]
     ));
-    $this->assertUrl(\Drupal::url('entity.configurable_language.collection', [], ['absolute' => TRUE]), [], 'Correct page redirection.');
+    $this->assertUrl(Url::fromRoute('entity.configurable_language.collection', [], ['absolute' => TRUE])->toString(), [], 'Correct page redirection.');
 
     // Add the language a second time and confirm that this is not allowed.
     $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add custom language'));
@@ -95,7 +96,7 @@
       'The language %language (%langcode) already exists.',
       ['%language' => $edit['label'], '%langcode' => $edit['langcode']]
     ));
-    $this->assertUrl(\Drupal::url('language.add', [], ['absolute' => TRUE]), [], 'Correct page redirection.');
+    $this->assertUrl(Url::fromRoute('language.add', [], ['absolute' => TRUE])->toString(), [], 'Correct page redirection.');
   }
 
 }