diff core/modules/node/tests/src/Functional/NodeTranslationUITest.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/node/tests/src/Functional/NodeTranslationUITest.php	Thu Feb 28 13:11:55 2019 +0000
+++ b/core/modules/node/tests/src/Functional/NodeTranslationUITest.php	Thu May 09 15:34:47 2019 +0100
@@ -26,6 +26,7 @@
     'timezone',
     'url.path.parent',
     'url.query_args:_wrapper_format',
+    'url.site',
     'user.roles',
     'url.path.is_front',
     // These two cache contexts are added by BigPipe.
@@ -161,7 +162,7 @@
       // statuses are (un)published accordingly.
       foreach ($this->langcodes as $langcode) {
         $options = ['language' => $languages[$langcode]];
-        $url = $entity->urlInfo('edit-form', $options);
+        $url = $entity->toUrl('edit-form', $options);
         $this->drupalPostForm($url, ['status[value]' => $value], t('Save') . $this->getFormSubmitSuffix($entity, $langcode), $options);
       }
       $storage->resetCache([$this->entityId]);
@@ -196,15 +197,17 @@
         'sticky' => (bool) mt_rand(0, 1),
         'promote' => (bool) mt_rand(0, 1),
       ];
+      /** @var \Drupal\Core\Datetime\DateFormatterInterface $date_formatter */
+      $date_formatter = $this->container->get('date.formatter');
       $edit = [
-        'uid[0][target_id]' => $user->getUsername(),
-        'created[0][value][date]' => format_date($values[$langcode]['created'], 'custom', 'Y-m-d'),
-        'created[0][value][time]' => format_date($values[$langcode]['created'], 'custom', 'H:i:s'),
+        'uid[0][target_id]' => $user->getAccountName(),
+        'created[0][value][date]' => $date_formatter->format($values[$langcode]['created'], 'custom', 'Y-m-d'),
+        'created[0][value][time]' => $date_formatter->format($values[$langcode]['created'], 'custom', 'H:i:s'),
         'sticky[value]' => $values[$langcode]['sticky'],
         'promote[value]' => $values[$langcode]['promote'],
       ];
       $options = ['language' => $languages[$langcode]];
-      $url = $entity->urlInfo('edit-form', $options);
+      $url = $entity->toUrl('edit-form', $options);
       $this->drupalPostForm($url, $edit, $this->getFormSubmitAction($entity, $langcode), $options);
     }
 
@@ -353,7 +356,7 @@
     $this->doTestTranslations('node/' . $node->id(), $values);
 
     // Test that the node page has the correct alternate hreflang links.
-    $this->doTestAlternateHreflangLinks($node->urlInfo());
+    $this->doTestAlternateHreflangLinks($node->toUrl());
   }
 
   /**
@@ -440,7 +443,7 @@
       // We only want to test the title for non-english translations.
       if ($langcode != 'en') {
         $options = ['language' => $languages[$langcode]];
-        $url = $entity->urlInfo('edit-form', $options);
+        $url = $entity->toUrl('edit-form', $options);
         $this->drupalGet($url);
 
         $title = t('<em>Edit @type</em> @title [%language translation]', [