Tests are now compliant with php-cs-fixer (CamelCase for method, phpdoc valid)
This commit is contained in:
@@ -1,67 +1,70 @@
|
||||
<?php
|
||||
|
||||
/** DomFramework - Tests
|
||||
* @package domframework
|
||||
* @author Dominique Fournier <dominique@fournier38.fr>
|
||||
* @license BSD
|
||||
*/
|
||||
/**
|
||||
* DomFramework - Tests
|
||||
* @package domframework
|
||||
* @author Dominique Fournier <dominique@fournier38.fr>
|
||||
* @license BSD
|
||||
*/
|
||||
|
||||
namespace Domframework\Tests;
|
||||
|
||||
use Domframework\Verify;
|
||||
|
||||
/** Test the Verify */
|
||||
/**
|
||||
* Test the Verify
|
||||
*/
|
||||
class VerifyTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
///////////////
|
||||
// DATES //
|
||||
///////////////
|
||||
public function test_is_datetimeSQL1()
|
||||
///////////////
|
||||
// DATES //
|
||||
///////////////
|
||||
public function testIsDatetimeSQL1()
|
||||
{
|
||||
$verify = new Verify();
|
||||
$res = $verify->is_datetimeSQL("2017-04-13 22:55:17");
|
||||
$this->assertSame($res, true);
|
||||
}
|
||||
|
||||
public function test_is_datetimeSQL2()
|
||||
public function testIsDatetimeSQL2()
|
||||
{
|
||||
$verify = new Verify();
|
||||
$res = $verify->is_datetimeSQL("2017-13-55 22:55:17");
|
||||
$this->assertSame($res, false);
|
||||
}
|
||||
|
||||
public function test_staticIs_datetimeSQL1()
|
||||
public function testStaticIsDatetimeSQL1()
|
||||
{
|
||||
$res = Verify::staticIs_datetimeSQL("2017-04-13 22:55:17");
|
||||
$this->assertSame($res, true);
|
||||
}
|
||||
|
||||
public function test_staticIs_datetimeSQL2()
|
||||
public function testStaticIsDatetimeSQL2()
|
||||
{
|
||||
$res = Verify::staticIs_datetimeSQL("2017-13-55 22:55:17");
|
||||
$this->assertSame($res, false);
|
||||
}
|
||||
public function test_is_dateSQL1()
|
||||
public function testIsDateSQL1()
|
||||
{
|
||||
$verify = new Verify();
|
||||
$res = $verify->is_dateSQL("2017-04-13");
|
||||
$this->assertSame($res, true);
|
||||
}
|
||||
|
||||
public function test_is_dateSQL2()
|
||||
public function testIsDateSQL2()
|
||||
{
|
||||
$verify = new Verify();
|
||||
$res = $verify->is_dateSQL("2017-13-55");
|
||||
$this->assertSame($res, false);
|
||||
}
|
||||
|
||||
public function test_staticIs_dateSQL1()
|
||||
public function testStaticIsDateSQL1()
|
||||
{
|
||||
$res = Verify::staticIs_dateSQL("2017-04-13");
|
||||
$this->assertSame($res, true);
|
||||
}
|
||||
|
||||
public function test_staticIs_dateSQL2()
|
||||
public function testStaticIsDateSQL2()
|
||||
{
|
||||
$res = Verify::staticIs_dateSQL("2017-13-55");
|
||||
$this->assertSame($res, false);
|
||||
@@ -71,13 +74,13 @@ class VerifyTest extends \PHPUnit_Framework_TestCase
|
||||
/////////////////
|
||||
// STRINGS //
|
||||
/////////////////
|
||||
public function test_staticIsAllowedChars_1()
|
||||
public function testStaticIsAllowedChars1()
|
||||
{
|
||||
$res = Verify::staticIsAllowedChars("éléphant", "abcd");
|
||||
$this->assertSame($res, false);
|
||||
}
|
||||
|
||||
public function test_staticIsAllowedChars_2()
|
||||
public function testStaticIsAllowedChars2()
|
||||
{
|
||||
$res = Verify::staticIsAllowedChars("éléphant", "anhplté");
|
||||
$this->assertSame($res, true);
|
||||
@@ -86,25 +89,25 @@ class VerifyTest extends \PHPUnit_Framework_TestCase
|
||||
/////////////////
|
||||
// NUMBERS //
|
||||
/////////////////
|
||||
public function test_staticIs_integer1()
|
||||
public function testStaticIsInteger1()
|
||||
{
|
||||
$res = Verify::staticIs_integer("2017-04-13 22:55:17");
|
||||
$this->assertSame($res, false);
|
||||
}
|
||||
|
||||
public function test_staticIs_integer2()
|
||||
public function testStaticIsInteger2()
|
||||
{
|
||||
$res = Verify::staticIs_integer("01234");
|
||||
$this->assertSame($res, true);
|
||||
}
|
||||
|
||||
public function test_staticIs_integer3()
|
||||
public function testStaticIsInteger3()
|
||||
{
|
||||
$res = Verify::staticIs_integer("0x1234");
|
||||
$this->assertSame($res, false);
|
||||
}
|
||||
|
||||
public function test_staticIs_integer4()
|
||||
public function testStaticIsInteger4()
|
||||
{
|
||||
$res = Verify::staticIs_integer("");
|
||||
$this->assertSame($res, false);
|
||||
@@ -117,27 +120,27 @@ class VerifyTest extends \PHPUnit_Framework_TestCase
|
||||
/////////////
|
||||
// URL //
|
||||
/////////////
|
||||
public function test_is_url1()
|
||||
public function testIsUrl1()
|
||||
{
|
||||
$verify = new Verify();
|
||||
$res = $verify->is_url("invalid");
|
||||
$this->assertsame($res, false);
|
||||
}
|
||||
|
||||
public function test_is_url2()
|
||||
public function testIsUrl2()
|
||||
{
|
||||
$verify = new Verify();
|
||||
$res = $verify->is_url("http://valid");
|
||||
$this->assertsame($res, true);
|
||||
}
|
||||
|
||||
public function test_staticIs_url1()
|
||||
public function testStaticIsUrl1()
|
||||
{
|
||||
$res = Verify::staticIs_url("invalid");
|
||||
$this->assertsame($res, false);
|
||||
}
|
||||
|
||||
public function test_staticIs_url2()
|
||||
public function testStaticIsUrl2()
|
||||
{
|
||||
$res = Verify::staticIs_url("http://valid");
|
||||
$this->assertsame($res, true);
|
||||
@@ -146,40 +149,40 @@ class VerifyTest extends \PHPUnit_Framework_TestCase
|
||||
////////////////
|
||||
// OTHERS //
|
||||
////////////////
|
||||
public function test_is_UUID1()
|
||||
public function testIsUUID1()
|
||||
{
|
||||
$verify = new Verify();
|
||||
$res = $verify->is_UUID("ca39275f-9224-425f-ba94-efce2aa5b52c");
|
||||
$this->assertsame($res, true);
|
||||
}
|
||||
|
||||
public function test_is_UUID2()
|
||||
public function testIsUUID2()
|
||||
{
|
||||
$verify = new Verify();
|
||||
$res = $verify->is_UUID("zz39275f-9224-425f-ba94-efce2aa5b52c");
|
||||
$this->assertsame($res, false);
|
||||
}
|
||||
|
||||
public function test_is_UUID3()
|
||||
public function testIsUUID3()
|
||||
{
|
||||
$verify = new Verify();
|
||||
$res = $verify->is_UUID("2c");
|
||||
$this->assertsame($res, false);
|
||||
}
|
||||
|
||||
public function test_staticis_UUID1()
|
||||
public function testStaticisUUID1()
|
||||
{
|
||||
$res = Verify::staticis_UUID("ca39275f-9224-425f-ba94-efce2aa5b52c");
|
||||
$this->assertsame($res, true);
|
||||
}
|
||||
|
||||
public function test_staticis_UUID2()
|
||||
public function testStaticisUUID2()
|
||||
{
|
||||
$res = Verify::staticis_UUID("zz39275f-9224-425f-ba94-efce2aa5b52c");
|
||||
$this->assertsame($res, false);
|
||||
}
|
||||
|
||||
public function test_staticis_UUID3()
|
||||
public function testStaticisUUID3()
|
||||
{
|
||||
$res = Verify::staticis_UUID("2c");
|
||||
$this->assertsame($res, false);
|
||||
|
||||
Reference in New Issue
Block a user