Mercurial > hg > isophonics-drupal-site
diff core/modules/statistics/tests/src/Functional/StatisticsTokenReplaceTest.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/statistics/tests/src/Functional/StatisticsTokenReplaceTest.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/statistics/tests/src/Functional/StatisticsTokenReplaceTest.php Thu May 09 15:33:08 2019 +0100 @@ -37,8 +37,10 @@ $tests = []; $tests['[node:total-count]'] = 1; $tests['[node:day-count]'] = 1; - $tests['[node:last-view]'] = format_date($statistics['timestamp']); - $tests['[node:last-view:short]'] = format_date($statistics['timestamp'], 'short'); + /** @var \Drupal\Core\Datetime\DateFormatterInterface $date_formatter */ + $date_formatter = $this->container->get('date.formatter'); + $tests['[node:last-view]'] = $date_formatter->format($statistics['timestamp']); + $tests['[node:last-view:short]'] = $date_formatter->format($statistics['timestamp'], 'short'); // Test to make sure that we generated something for each token. $this->assertFalse(in_array(0, array_map('strlen', $tests)), 'No empty tokens generated.');