git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3521 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
26 lines
618 B
PHP
26 lines
618 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", true);
|
|
}
|
|
|
|
public function test_convertDate3 ()
|
|
{
|
|
$res = \convert::convertDate ("2017-13-33", "Y-m-d", "d/m/Y");
|
|
$this->assertSame ($res, "2017-13-33");
|
|
}
|
|
}
|