Skip to content
Snippets Groups Projects
Unverified Commit a0f43e0a authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3019115 by tamer.kamel, Waldoswndrwrld, anantjain60, gnuget, Berdir,...

Issue #3019115 by tamer.kamel, Waldoswndrwrld, anantjain60, gnuget, Berdir, alexpott: TwigExtensionTest::testFormatDate() doesn't make much sense
parent c91f2365
No related merge requests found
......@@ -148,15 +148,18 @@ public function testActiveTheme() {
* Tests the format_date filter.
*/
public function testFormatDate() {
$this->dateFormatter->expects($this->exactly(2))
$this->dateFormatter->expects($this->exactly(1))
->method('format')
->willReturn('1978-11-19');
->will($this->returnCallback(function ($timestamp) {
return date('Y-m-d', $timestamp);
}));
$loader = new StringLoader();
$twig = new \Twig_Environment($loader);
$twig->addExtension($this->systemUnderTest);
$result = $twig->render('{{ time|format_date("html_date") }}');
$this->assertEquals($this->dateFormatter->format('html_date'), $result);
$timestamp = strtotime('1978-11-19');
$result = $twig->render('{{ time|format_date("html_date") }}', ['time' => $timestamp]);
$this->assertEquals('1978-11-19', $result);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment