|
@@ -6,14 +6,14 @@ use Cake\Core\Plugin;
|
|
|
use Cake\Core\Configure;
|
|
use Cake\Core\Configure;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @covers Utility
|
|
|
|
|
|
|
+ * @coversDefaultClass \Tools\Utility\Utility
|
|
|
*/
|
|
*/
|
|
|
class UtilityTest extends TestCase {
|
|
class UtilityTest extends TestCase {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* UtilityTest::testInArray()
|
|
* UtilityTest::testInArray()
|
|
|
*
|
|
*
|
|
|
- * @covers Utility::inArray
|
|
|
|
|
|
|
+ * @covers ::inArray
|
|
|
* @return void
|
|
* @return void
|
|
|
*/
|
|
*/
|
|
|
public function testInArray() {
|
|
public function testInArray() {
|
|
@@ -56,7 +56,7 @@ class UtilityTest extends TestCase {
|
|
|
/**
|
|
/**
|
|
|
* UtilityTest::testPregMatch()
|
|
* UtilityTest::testPregMatch()
|
|
|
*
|
|
*
|
|
|
- * @covers Utility::pregMatch
|
|
|
|
|
|
|
+ * @covers ::pregMatch
|
|
|
* @return void
|
|
* @return void
|
|
|
*/
|
|
*/
|
|
|
public function testPregMatch() {
|
|
public function testPregMatch() {
|
|
@@ -92,7 +92,7 @@ class UtilityTest extends TestCase {
|
|
|
/**
|
|
/**
|
|
|
* UtilityTest::testPregMatchWithPatternEscape()
|
|
* UtilityTest::testPregMatchWithPatternEscape()
|
|
|
*
|
|
*
|
|
|
- * @covers Utility::pregMatch
|
|
|
|
|
|
|
+ * @covers ::pregMatch
|
|
|
* @return void
|
|
* @return void
|
|
|
*/
|
|
*/
|
|
|
public function testPregMatchWithPatternEscape() {
|
|
public function testPregMatchWithPatternEscape() {
|
|
@@ -114,7 +114,7 @@ class UtilityTest extends TestCase {
|
|
|
/**
|
|
/**
|
|
|
* UtilityTest::testPregMatchAll()
|
|
* UtilityTest::testPregMatchAll()
|
|
|
*
|
|
*
|
|
|
- * @covers Utility::pregMatchAll
|
|
|
|
|
|
|
+ * @covers ::pregMatchAll
|
|
|
* @return void
|
|
* @return void
|
|
|
*/
|
|
*/
|
|
|
public function testPregMatchAll() {
|
|
public function testPregMatchAll() {
|
|
@@ -138,7 +138,7 @@ class UtilityTest extends TestCase {
|
|
|
/**
|
|
/**
|
|
|
* UtilityTest::testStrSplit()
|
|
* UtilityTest::testStrSplit()
|
|
|
*
|
|
*
|
|
|
- * @covers Utility::strSplit
|
|
|
|
|
|
|
+ * @covers ::strSplit
|
|
|
* @return void
|
|
* @return void
|
|
|
*/
|
|
*/
|
|
|
public function testStrSplit() {
|
|
public function testStrSplit() {
|
|
@@ -153,7 +153,7 @@ class UtilityTest extends TestCase {
|
|
|
/**
|
|
/**
|
|
|
* UtilityTest::testUrlEncode()
|
|
* UtilityTest::testUrlEncode()
|
|
|
*
|
|
*
|
|
|
- * @covers Utility::urlEncode
|
|
|
|
|
|
|
+ * @covers ::urlEncode
|
|
|
* @return void
|
|
* @return void
|
|
|
*/
|
|
*/
|
|
|
public function testUrlEncode() {
|
|
public function testUrlEncode() {
|
|
@@ -164,7 +164,7 @@ class UtilityTest extends TestCase {
|
|
|
/**
|
|
/**
|
|
|
* UtilityTest::testUrlDecode()
|
|
* UtilityTest::testUrlDecode()
|
|
|
*
|
|
*
|
|
|
- * @covers Utility::urlDecode
|
|
|
|
|
|
|
+ * @covers ::urlDecode
|
|
|
* @return void
|
|
* @return void
|
|
|
*/
|
|
*/
|
|
|
public function testUrlDecode() {
|
|
public function testUrlDecode() {
|
|
@@ -175,7 +175,7 @@ class UtilityTest extends TestCase {
|
|
|
/**
|
|
/**
|
|
|
* UtilityTest::testTypeCast()
|
|
* UtilityTest::testTypeCast()
|
|
|
*
|
|
*
|
|
|
- * @covers Utility::typeCast
|
|
|
|
|
|
|
+ * @covers ::typeCast
|
|
|
* @return void
|
|
* @return void
|
|
|
*/
|
|
*/
|
|
|
public function testTypeCast() {
|
|
public function testTypeCast() {
|
|
@@ -187,7 +187,7 @@ class UtilityTest extends TestCase {
|
|
|
/**
|
|
/**
|
|
|
* UtilityTest::testGetClientIp()
|
|
* UtilityTest::testGetClientIp()
|
|
|
*
|
|
*
|
|
|
- * @covers Utility::getClientIp
|
|
|
|
|
|
|
+ * @covers ::getClientIp
|
|
|
* @return void
|
|
* @return void
|
|
|
*/
|
|
*/
|
|
|
public function testGetClientIp() {
|
|
public function testGetClientIp() {
|
|
@@ -198,7 +198,7 @@ class UtilityTest extends TestCase {
|
|
|
/**
|
|
/**
|
|
|
* UtilityTest::testFileExists()
|
|
* UtilityTest::testFileExists()
|
|
|
*
|
|
*
|
|
|
- * @covers Utility::fileExists
|
|
|
|
|
|
|
+ * @covers ::fileExists
|
|
|
* @return void
|
|
* @return void
|
|
|
*/
|
|
*/
|
|
|
public function testFileExists() {
|
|
public function testFileExists() {
|
|
@@ -218,7 +218,7 @@ class UtilityTest extends TestCase {
|
|
|
/**
|
|
/**
|
|
|
* UtilityTest::testUrlExists()
|
|
* UtilityTest::testUrlExists()
|
|
|
*
|
|
*
|
|
|
- * @covers Utility::urlExists
|
|
|
|
|
|
|
+ * @covers ::urlExists
|
|
|
* @return void
|
|
* @return void
|
|
|
*/
|
|
*/
|
|
|
public function testUrlExists() {
|
|
public function testUrlExists() {
|
|
@@ -232,7 +232,7 @@ class UtilityTest extends TestCase {
|
|
|
/**
|
|
/**
|
|
|
* UtilityTest::testGetReferer()
|
|
* UtilityTest::testGetReferer()
|
|
|
*
|
|
*
|
|
|
- * @covers Utility::getReferer
|
|
|
|
|
|
|
+ * @covers ::getReferer
|
|
|
* @return void
|
|
* @return void
|
|
|
*/
|
|
*/
|
|
|
public function testGetReferer() {
|
|
public function testGetReferer() {
|
|
@@ -254,7 +254,7 @@ class UtilityTest extends TestCase {
|
|
|
/**
|
|
/**
|
|
|
* UtilityTest::testGetHeaderFromUrl()
|
|
* UtilityTest::testGetHeaderFromUrl()
|
|
|
*
|
|
*
|
|
|
- * @covers Utility::getHeaderFromUrl
|
|
|
|
|
|
|
+ * @covers ::getHeaderFromUrl
|
|
|
* @return void
|
|
* @return void
|
|
|
*/
|
|
*/
|
|
|
public function testGetHeaderFromUrl() {
|
|
public function testGetHeaderFromUrl() {
|
|
@@ -266,7 +266,7 @@ class UtilityTest extends TestCase {
|
|
|
/**
|
|
/**
|
|
|
* UtilityTest::testAutoPrefixUrl()
|
|
* UtilityTest::testAutoPrefixUrl()
|
|
|
*
|
|
*
|
|
|
- * @covers Utility::autoPrefixUrl
|
|
|
|
|
|
|
+ * @covers ::autoPrefixUrl
|
|
|
* @return void
|
|
* @return void
|
|
|
*/
|
|
*/
|
|
|
public function testAutoPrefixUrl() {
|
|
public function testAutoPrefixUrl() {
|
|
@@ -277,7 +277,7 @@ class UtilityTest extends TestCase {
|
|
|
/**
|
|
/**
|
|
|
* UtilityTest::testCleanUrl()
|
|
* UtilityTest::testCleanUrl()
|
|
|
*
|
|
*
|
|
|
- * @covers Utility::cleanUrl
|
|
|
|
|
|
|
+ * @covers ::cleanUrl
|
|
|
* @return void
|
|
* @return void
|
|
|
*/
|
|
*/
|
|
|
public function testCleanUrl() {
|
|
public function testCleanUrl() {
|
|
@@ -301,7 +301,7 @@ class UtilityTest extends TestCase {
|
|
|
/**
|
|
/**
|
|
|
* UtilityTest::testDeep()
|
|
* UtilityTest::testDeep()
|
|
|
*
|
|
*
|
|
|
- * @covers Utility::trimDeep
|
|
|
|
|
|
|
+ * @covers ::trimDeep
|
|
|
* @return void
|
|
* @return void
|
|
|
*/
|
|
*/
|
|
|
public function testDeep() {
|
|
public function testDeep() {
|
|
@@ -512,7 +512,7 @@ class UtilityTest extends TestCase {
|
|
|
/**
|
|
/**
|
|
|
* UtilityTest::testArrayFlattenBasic()
|
|
* UtilityTest::testArrayFlattenBasic()
|
|
|
*
|
|
*
|
|
|
- * @covers Utility::arrayFlatten
|
|
|
|
|
|
|
+ * @covers ::arrayFlatten
|
|
|
* @return void
|
|
* @return void
|
|
|
*/
|
|
*/
|
|
|
public function testArrayFlattenBasic() {
|
|
public function testArrayFlattenBasic() {
|
|
@@ -537,7 +537,7 @@ class UtilityTest extends TestCase {
|
|
|
/**
|
|
/**
|
|
|
* Test that deeper nested values overwrite higher ones.
|
|
* Test that deeper nested values overwrite higher ones.
|
|
|
*
|
|
*
|
|
|
- * @covers Utility::arrayFlatten
|
|
|
|
|
|
|
+ * @covers ::arrayFlatten
|
|
|
* @return void
|
|
* @return void
|
|
|
*/
|
|
*/
|
|
|
public function testArrayFlatten() {
|
|
public function testArrayFlatten() {
|
|
@@ -560,7 +560,7 @@ class UtilityTest extends TestCase {
|
|
|
/**
|
|
/**
|
|
|
* UtilityTest::testArrayFlattenAndPreserveKeys()
|
|
* UtilityTest::testArrayFlattenAndPreserveKeys()
|
|
|
*
|
|
*
|
|
|
- * @covers Utility::arrayFlatten
|
|
|
|
|
|
|
+ * @covers ::arrayFlatten
|
|
|
* @return void
|
|
* @return void
|
|
|
*/
|
|
*/
|
|
|
public function testArrayFlattenAndPreserveKeys() {
|
|
public function testArrayFlattenAndPreserveKeys() {
|
|
@@ -582,7 +582,7 @@ class UtilityTest extends TestCase {
|
|
|
/**
|
|
/**
|
|
|
* UtilityTest::testArrayShiftKeys()
|
|
* UtilityTest::testArrayShiftKeys()
|
|
|
*
|
|
*
|
|
|
- * @covers Utility::arrayShiftKeys
|
|
|
|
|
|
|
+ * @covers ::arrayShiftKeys
|
|
|
* @return void
|
|
* @return void
|
|
|
*/
|
|
*/
|
|
|
public function testArrayShiftKeys() {
|
|
public function testArrayShiftKeys() {
|
|
@@ -605,7 +605,7 @@ class UtilityTest extends TestCase {
|
|
|
/**
|
|
/**
|
|
|
* UtilityTest::testTime()
|
|
* UtilityTest::testTime()
|
|
|
*
|
|
*
|
|
|
- * @covers Utility::returnElapsedTime
|
|
|
|
|
|
|
+ * @covers ::returnElapsedTime
|
|
|
* @return void
|
|
* @return void
|
|
|
*/
|
|
*/
|
|
|
public function testTime() {
|
|
public function testTime() {
|
|
@@ -626,7 +626,7 @@ class UtilityTest extends TestCase {
|
|
|
/**
|
|
/**
|
|
|
* UtilityTest::testLogicalAnd()
|
|
* UtilityTest::testLogicalAnd()
|
|
|
*
|
|
*
|
|
|
- * @covers Utility::logicalAnd
|
|
|
|
|
|
|
+ * @covers ::logicalAnd
|
|
|
* @return void
|
|
* @return void
|
|
|
*/
|
|
*/
|
|
|
public function testLogicalAnd() {
|
|
public function testLogicalAnd() {
|
|
@@ -652,7 +652,7 @@ class UtilityTest extends TestCase {
|
|
|
/**
|
|
/**
|
|
|
* UtilityTest::testLogicalOr()
|
|
* UtilityTest::testLogicalOr()
|
|
|
*
|
|
*
|
|
|
- * @covers Utility::logicalOr
|
|
|
|
|
|
|
+ * @covers ::logicalOr
|
|
|
* @return void
|
|
* @return void
|
|
|
*/
|
|
*/
|
|
|
public function testLogicalOr() {
|
|
public function testLogicalOr() {
|
|
@@ -687,7 +687,7 @@ class UtilityTest extends TestCase {
|
|
|
/**
|
|
/**
|
|
|
* UtilityTest::testIsValidSaveAll()
|
|
* UtilityTest::testIsValidSaveAll()
|
|
|
*
|
|
*
|
|
|
- * @covers Utility::isValidSaveAll
|
|
|
|
|
|
|
+ * @covers ::isValidSaveAll
|
|
|
* @return void
|
|
* @return void
|
|
|
*/
|
|
*/
|
|
|
public function testIsValidSaveAll() {
|
|
public function testIsValidSaveAll() {
|