From 7ca339492f50825aacdcfbc68de4a9f379476cc2 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Fri, 25 Oct 2013 11:21:39 +0200 Subject: [PATCH] fix test suite --- core/lib/Thelia/Core/Template/Smarty/Plugins/Format.php | 2 +- .../Tests/Core/Template/Smarty/Plugins/FormatTest.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/Format.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/Format.php index aa4aacc9e..05c7bb0f6 100644 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/Format.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/Format.php @@ -76,7 +76,7 @@ class Format extends AbstractSmartyPlugin return ""; } - if (!$date instanceof \DateTime) { + if (!($date instanceof \DateTime)) { return ""; } diff --git a/core/lib/Thelia/Tests/Core/Template/Smarty/Plugins/FormatTest.php b/core/lib/Thelia/Tests/Core/Template/Smarty/Plugins/FormatTest.php index e8d5ff0fc..979642677 100644 --- a/core/lib/Thelia/Tests/Core/Template/Smarty/Plugins/FormatTest.php +++ b/core/lib/Thelia/Tests/Core/Template/Smarty/Plugins/FormatTest.php @@ -155,7 +155,6 @@ class FormatTest extends \PHPUnit_Framework_TestCase * test formatDate without mandatory parameters * * @covers ::formatDate - * @expectedException \Thelia\Core\Template\Smarty\Exception\SmartyPluginException */ public function testFormatDateWithoutDate() { @@ -165,20 +164,21 @@ class FormatTest extends \PHPUnit_Framework_TestCase $render = $formatClass->formatDate(array()); - $this->assertEquals($dateTime->format("Y-m-d H:i:s"), $render); + $this->assertEmpty($render); } /** * test formatNumber without mandatory parameters * * @covers ::formatNumber - * @expectedException \Thelia\Core\Template\Smarty\Exception\SmartyPluginException */ public function testFormatNumberWithoutParams() { $formatClass = new Format($this->request); $render = $formatClass->formatNumber(array()); + + $this->assertEmpty($render); } /**