Passage en Namespace et tous les tests fonctionnels OK

This commit is contained in:
2021-05-10 11:48:15 +02:00
parent 536dd0d56b
commit eb30d8ef97
56 changed files with 1091 additions and 964 deletions

View File

@@ -7,60 +7,62 @@
namespace Domframework\Tests;
use Domframework\Verify;
/** Test the Verify */
class verifyTest extends \PHPUnit_Framework_TestCase
class VerifyTest extends \PHPUnit_Framework_TestCase
{
///////////////
// DATES //
///////////////
public function test_is_datetimeSQL1 ()
{
$verify = new \verify ();
$verify = new Verify ();
$res = $verify->is_datetimeSQL ("2017-04-13 22:55:17");
$this->assertSame ($res, true);
}
public function test_is_datetimeSQL2 ()
{
$verify = new \verify ();
$verify = new Verify ();
$res = $verify->is_datetimeSQL ("2017-13-55 22:55:17");
$this->assertSame ($res, false);
}
public function test_staticIs_datetimeSQL1 ()
{
$res = \verify::staticIs_datetimeSQL ("2017-04-13 22:55:17");
$res = Verify::staticIs_datetimeSQL ("2017-04-13 22:55:17");
$this->assertSame ($res, true);
}
public function test_staticIs_datetimeSQL2 ()
{
$res = \verify::staticIs_datetimeSQL ("2017-13-55 22:55:17");
$res = Verify::staticIs_datetimeSQL ("2017-13-55 22:55:17");
$this->assertSame ($res, false);
}
public function test_is_dateSQL1 ()
{
$verify = new \verify ();
$verify = new Verify ();
$res = $verify->is_dateSQL ("2017-04-13");
$this->assertSame ($res, true);
}
public function test_is_dateSQL2 ()
{
$verify = new \verify ();
$verify = new Verify ();
$res = $verify->is_dateSQL ("2017-13-55");
$this->assertSame ($res, false);
}
public function test_staticIs_dateSQL1 ()
{
$res = \verify::staticIs_dateSQL ("2017-04-13");
$res = Verify::staticIs_dateSQL ("2017-04-13");
$this->assertSame ($res, true);
}
public function test_staticIs_dateSQL2 ()
{
$res = \verify::staticIs_dateSQL ("2017-13-55");
$res = Verify::staticIs_dateSQL ("2017-13-55");
$this->assertSame ($res, false);
}
@@ -70,13 +72,13 @@ class verifyTest extends \PHPUnit_Framework_TestCase
/////////////////
public function test_staticIsAllowedChars_1 ()
{
$res = \verify::staticIsAllowedChars ("éléphant", "abcd");
$res = Verify::staticIsAllowedChars ("éléphant", "abcd");
$this->assertSame ($res, false);
}
public function test_staticIsAllowedChars_2 ()
{
$res = \verify::staticIsAllowedChars ("éléphant", "anhplté");
$res = Verify::staticIsAllowedChars ("éléphant", "anhplté");
$this->assertSame ($res, true);
}
@@ -85,25 +87,25 @@ class verifyTest extends \PHPUnit_Framework_TestCase
/////////////////
public function test_staticIs_integer1 ()
{
$res = \verify::staticIs_integer ("2017-04-13 22:55:17");
$res = Verify::staticIs_integer ("2017-04-13 22:55:17");
$this->assertSame ($res, false);
}
public function test_staticIs_integer2 ()
{
$res = \verify::staticIs_integer ("01234");
$res = Verify::staticIs_integer ("01234");
$this->assertSame ($res, true);
}
public function test_staticIs_integer3 ()
{
$res = \verify::staticIs_integer ("0x1234");
$res = Verify::staticIs_integer ("0x1234");
$this->assertSame ($res, false);
}
public function test_staticIs_integer4 ()
{
$res = \verify::staticIs_integer ("");
$res = Verify::staticIs_integer ("");
$this->assertSame ($res, false);
}
@@ -116,27 +118,27 @@ class verifyTest extends \PHPUnit_Framework_TestCase
/////////////
public function test_is_url1 ()
{
$verify = new \verify ();
$verify = new Verify ();
$res = $verify->is_url ("invalid");
$this->assertsame ($res, false);
}
public function test_is_url2 ()
{
$verify = new \verify ();
$verify = new Verify ();
$res = $verify->is_url ("http://valid");
$this->assertsame ($res, true);
}
public function test_staticIs_url1 ()
{
$res = \verify::staticIs_url ("invalid");
$res = Verify::staticIs_url ("invalid");
$this->assertsame ($res, false);
}
public function test_staticIs_url2 ()
{
$res = \verify::staticIs_url ("http://valid");
$res = Verify::staticIs_url ("http://valid");
$this->assertsame ($res, true);
}
@@ -145,40 +147,40 @@ class verifyTest extends \PHPUnit_Framework_TestCase
////////////////
public function test_is_UUID1 ()
{
$verify = new \verify ();
$verify = new Verify ();
$res = $verify->is_UUID ("ca39275f-9224-425f-ba94-efce2aa5b52c");
$this->assertsame ($res, true);
}
public function test_is_UUID2 ()
{
$verify = new \verify ();
$verify = new Verify ();
$res = $verify->is_UUID ("zz39275f-9224-425f-ba94-efce2aa5b52c");
$this->assertsame ($res, false);
}
public function test_is_UUID3 ()
{
$verify = new \verify ();
$verify = new Verify ();
$res = $verify->is_UUID ("2c");
$this->assertsame ($res, false);
}
public function test_staticis_UUID1 ()
{
$res = \verify::staticis_UUID ("ca39275f-9224-425f-ba94-efce2aa5b52c");
$res = Verify::staticis_UUID ("ca39275f-9224-425f-ba94-efce2aa5b52c");
$this->assertsame ($res, true);
}
public function test_staticis_UUID2 ()
{
$res = \verify::staticis_UUID ("zz39275f-9224-425f-ba94-efce2aa5b52c");
$res = Verify::staticis_UUID ("zz39275f-9224-425f-ba94-efce2aa5b52c");
$this->assertsame ($res, false);
}
public function test_staticis_UUID3 ()
{
$res = \verify::staticis_UUID ("2c");
$res = Verify::staticis_UUID ("2c");
$this->assertsame ($res, false);
}
}