Mercurial > hg > cmmr2012-drupal-site
diff core/modules/comment/tests/src/Functional/CommentTranslationUITest.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/comment/tests/src/Functional/CommentTranslationUITest.php Thu Feb 28 13:11:55 2019 +0000 +++ b/core/modules/comment/tests/src/Functional/CommentTranslationUITest.php Thu May 09 15:34:47 2019 +0100 @@ -38,6 +38,7 @@ 'timezone', 'url.query_args:_wrapper_format', 'url.query_args.pagers:0', + 'url.site', 'user.permissions', 'user.roles', ]; @@ -134,7 +135,7 @@ foreach ($this->langcodes as $index => $langcode) { if ($index > 0) { $edit = ['status' => 0]; - $url = $entity->urlInfo('edit-form', ['language' => ConfigurableLanguage::load($langcode)]); + $url = $entity->toUrl('edit-form', ['language' => ConfigurableLanguage::load($langcode)]); $this->drupalPostForm($url, $edit, $this->getFormSubmitAction($entity, $langcode)); $storage->resetCache(); $entity = $storage->load($this->entityId); @@ -156,16 +157,18 @@ // Post different authoring information for each translation. foreach ($this->langcodes as $langcode) { - $url = $entity->urlInfo('edit-form', ['language' => $languages[$langcode]]); + $url = $entity->toUrl('edit-form', ['language' => $languages[$langcode]]); $user = $this->drupalCreateUser(); $values[$langcode] = [ 'uid' => $user->id(), 'created' => REQUEST_TIME - mt_rand(0, 1000), ]; + /** @var \Drupal\Core\Datetime\DateFormatterInterface $date_formatter */ + $date_formatter = $this->container->get('date.formatter'); $edit = [ - 'uid' => $user->getUsername() . ' (' . $user->id() . ')', - 'date[date]' => format_date($values[$langcode]['created'], 'custom', 'Y-m-d'), - 'date[time]' => format_date($values[$langcode]['created'], 'custom', 'H:i:s'), + 'uid' => $user->getAccountName() . ' (' . $user->id() . ')', + 'date[date]' => $date_formatter->format($values[$langcode]['created'], 'custom', 'Y-m-d'), + 'date[time]' => $date_formatter->format($values[$langcode]['created'], 'custom', 'H:i:s'), ]; $this->drupalPostForm($url, $edit, $this->getFormSubmitAction($entity, $langcode)); } @@ -210,7 +213,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('Edit @type @title [%language translation]', [