Files
DomFramework/Tests/convertTest.php
2017-04-13 12:17:57 +00:00

26 lines
619 B
PHP

<?php
require_once ("convert.php");
/** Test the Conversion of format */
class test_convert extends PHPUnit_Framework_TestCase
{
public function test_convertDate1 ()
{
$res = \convert::convertDate ("2017-04-13", "Y-m-d", "d/m/Y");
$this->assertSame ($res, "13/04/2017");
}
public function test_convertDate2 ()
{
$this->setExpectedException ("Exception");
$res = \convert::convertDate ("2017-13-33", "Y-m-d", "d/m/Y");
}
public function test_convertDate3 ()
{
$res = \convert::convertDate ("2017-13-33", "Y-m-d", "d/m/Y", false);
$this->assertSame ($res, "2017-13-33");
}
}