fix test suite
This commit is contained in:
@@ -76,7 +76,7 @@ class Format extends AbstractSmartyPlugin
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$date instanceof \DateTime) {
|
if (!($date instanceof \DateTime)) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -155,7 +155,6 @@ class FormatTest extends \PHPUnit_Framework_TestCase
|
|||||||
* test formatDate without mandatory parameters
|
* test formatDate without mandatory parameters
|
||||||
*
|
*
|
||||||
* @covers ::formatDate
|
* @covers ::formatDate
|
||||||
* @expectedException \Thelia\Core\Template\Smarty\Exception\SmartyPluginException
|
|
||||||
*/
|
*/
|
||||||
public function testFormatDateWithoutDate()
|
public function testFormatDateWithoutDate()
|
||||||
{
|
{
|
||||||
@@ -165,20 +164,21 @@ class FormatTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
$render = $formatClass->formatDate(array());
|
$render = $formatClass->formatDate(array());
|
||||||
|
|
||||||
$this->assertEquals($dateTime->format("Y-m-d H:i:s"), $render);
|
$this->assertEmpty($render);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test formatNumber without mandatory parameters
|
* test formatNumber without mandatory parameters
|
||||||
*
|
*
|
||||||
* @covers ::formatNumber
|
* @covers ::formatNumber
|
||||||
* @expectedException \Thelia\Core\Template\Smarty\Exception\SmartyPluginException
|
|
||||||
*/
|
*/
|
||||||
public function testFormatNumberWithoutParams()
|
public function testFormatNumberWithoutParams()
|
||||||
{
|
{
|
||||||
$formatClass = new Format($this->request);
|
$formatClass = new Format($this->request);
|
||||||
|
|
||||||
$render = $formatClass->formatNumber(array());
|
$render = $formatClass->formatNumber(array());
|
||||||
|
|
||||||
|
$this->assertEmpty($render);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user