2012-05-09 10:43:56 -04:00
|
|
|
<?php
|
2012-05-09 17:19:35 -04:00
|
|
|
require_once PATH_TRUNK . 'gulliver' . PATH_SEP . "system" . PATH_SEP . "class.g.php";
|
|
|
|
|
|
2012-05-09 10:43:56 -04:00
|
|
|
/**
|
|
|
|
|
* Generated by PHPUnit_SkeletonGenerator on 2012-05-09 at 10:14:57.
|
|
|
|
|
*/
|
|
|
|
|
class GTest extends PHPUnit_Framework_TestCase
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::is_https
|
|
|
|
|
* @todo Implement testIs_https().
|
|
|
|
|
*/
|
|
|
|
|
public function testIs_https()
|
|
|
|
|
{
|
2012-05-09 17:19:35 -04:00
|
|
|
$this->assertFalse(G::is_https());
|
|
|
|
|
|
|
|
|
|
$_SERVER̈́['HTTPS'] = '';
|
|
|
|
|
$this->assertFalse(G::is_https());
|
|
|
|
|
|
|
|
|
|
$_SERVER['HTTPS'] = 'on';
|
|
|
|
|
$this->assertTrue(G::is_https());
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::array_fill_value
|
|
|
|
|
* @todo Implement testArray_fill_value().
|
|
|
|
|
*/
|
|
|
|
|
public function testArray_fill_value()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$arrayTest = '1';
|
|
|
|
|
$arrayRes = G::array_fill_value($arrayTest);
|
|
|
|
|
$this->assertTrue( (is_array($arrayRes) && (count($arrayRes) == 0)) );
|
|
|
|
|
|
|
|
|
|
// $recursive = false and new Value = ''
|
|
|
|
|
$arrayTest = array('value1','value2','value3','value4');
|
|
|
|
|
$arrayRes = G::array_fill_value($arrayTest);
|
|
|
|
|
$this->assertEquals($arrayRes['0'],'');
|
|
|
|
|
$this->assertEquals($arrayRes['1'],'');
|
|
|
|
|
$this->assertEquals($arrayRes['2'],'');
|
|
|
|
|
$this->assertEquals($arrayRes['3'],'');
|
|
|
|
|
|
|
|
|
|
// $recursive = false and new Value = 'valueTest'
|
|
|
|
|
$arrayTest = array('value1','value2','value3','value4');
|
|
|
|
|
$arrayRes = G::array_fill_value($arrayTest,'valueTest');
|
|
|
|
|
$this->assertEquals($arrayRes['0'],'valueTest');
|
|
|
|
|
$this->assertEquals($arrayRes['1'],'valueTest');
|
|
|
|
|
$this->assertEquals($arrayRes['2'],'valueTest');
|
|
|
|
|
$this->assertEquals($arrayRes['3'],'valueTest');
|
|
|
|
|
|
|
|
|
|
// $recursive = true and new Value = 'valueTest'
|
|
|
|
|
$arrayTestSub1 = array('value11', 'value12', 'value13');
|
|
|
|
|
$arrayTestSub2 = array('value21', 'value22', 'value23');
|
|
|
|
|
$arrayTestSub3 = array('value31', 'value32', 'value33');
|
|
|
|
|
$arrayTest = array('value1', $arrayTestSub1, $arrayTestSub1, $arrayTestSub1);
|
|
|
|
|
$arrayRes = G::array_fill_value($arrayTest,'valueTest',true);
|
|
|
|
|
$this->assertEquals($arrayRes['0'],'valueTest');
|
|
|
|
|
$this->assertEquals($arrayRes['1']['0'],'valueTest');
|
|
|
|
|
$this->assertEquals($arrayRes['1']['1'],'valueTest');
|
|
|
|
|
$this->assertEquals($arrayRes['1']['2'],'valueTest');
|
|
|
|
|
|
|
|
|
|
$this->assertEquals($arrayRes['2']['0'],'valueTest');
|
|
|
|
|
$this->assertEquals($arrayRes['2']['1'],'valueTest');
|
|
|
|
|
$this->assertEquals($arrayRes['2']['2'],'valueTest');
|
|
|
|
|
|
|
|
|
|
$this->assertEquals($arrayRes['3']['0'],'valueTest');
|
|
|
|
|
$this->assertEquals($arrayRes['3']['1'],'valueTest');
|
|
|
|
|
$this->assertEquals($arrayRes['3']['2'],'valueTest');
|
|
|
|
|
|
|
|
|
|
// $recursive = true and new Value = ''
|
|
|
|
|
$arrayTestSub1 = array('value11', 'value12', 'value13');
|
|
|
|
|
$arrayTestSub2 = array('value21', 'value22', 'value23');
|
|
|
|
|
$arrayTestSub3 = array('value31', 'value32', 'value33');
|
|
|
|
|
$arrayTest = array('value1', $arrayTestSub1, $arrayTestSub1, $arrayTestSub1);
|
|
|
|
|
$arrayRes = G::array_fill_value($arrayTest,'',true);
|
|
|
|
|
$this->assertEquals($arrayRes['0'],'');
|
|
|
|
|
$this->assertEquals($arrayRes['1']['0'],'');
|
|
|
|
|
$this->assertEquals($arrayRes['1']['1'],'');
|
|
|
|
|
$this->assertEquals($arrayRes['1']['2'],'');
|
|
|
|
|
|
|
|
|
|
$this->assertEquals($arrayRes['2']['0'],'');
|
|
|
|
|
$this->assertEquals($arrayRes['2']['1'],'');
|
|
|
|
|
$this->assertEquals($arrayRes['2']['2'],'');
|
|
|
|
|
|
|
|
|
|
$this->assertEquals($arrayRes['3']['0'],'');
|
|
|
|
|
$this->assertEquals($arrayRes['3']['1'],'');
|
|
|
|
|
$this->assertEquals($arrayRes['3']['2'],'');
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::generate_password
|
|
|
|
|
* @todo Implement testGenerate_password().
|
|
|
|
|
*/
|
|
|
|
|
public function testGenerate_password()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
// $length = ''
|
|
|
|
|
$responsePass = G::generate_password();
|
|
|
|
|
$this->assertEquals(strlen($responsePass),8);
|
|
|
|
|
|
|
|
|
|
// $length = '32'
|
|
|
|
|
$responsePass = G::generate_password(10);
|
|
|
|
|
$this->assertEquals(strlen($responsePass),10);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::array_concat
|
|
|
|
|
* @todo Implement testArray_concat().
|
|
|
|
|
*/
|
|
|
|
|
public function testArray_concat()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$arrayTest1 = array('value11','value12');
|
|
|
|
|
$arrayTest2 = array('value21','value22');
|
|
|
|
|
$arrayTest3 = array('value31','value32');
|
|
|
|
|
$arrayTest = array($arrayTest1, $arrayTest2, $arrayTest3);
|
|
|
|
|
|
|
|
|
|
$arrayResponse = G::array_concat($arrayTest);
|
|
|
|
|
|
|
|
|
|
$this->assertEquals($arrayResponse['0']['0'],'value11');
|
|
|
|
|
$this->assertEquals($arrayResponse['0']['1'],'value12');
|
|
|
|
|
$this->assertEquals($arrayResponse['1']['0'],'value21');
|
|
|
|
|
$this->assertEquals($arrayResponse['1']['1'],'value22');
|
|
|
|
|
$this->assertEquals($arrayResponse['2']['0'],'value31');
|
|
|
|
|
$this->assertEquals($arrayResponse['2']['1'],'value32');
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::var_compare
|
|
|
|
|
* @todo Implement testVar_compare().
|
|
|
|
|
*/
|
|
|
|
|
public function testVar_compare()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
/**
|
|
|
|
|
* @error : Function may receive only one variable, but fires a warning.
|
|
|
|
|
@example : <php G::var_compare(true); ?>
|
|
|
|
|
*/
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
$this->assertTrue(G::var_compare(true,true));
|
|
|
|
|
|
|
|
|
|
$this->assertFalse(G::var_compare(true,false));
|
|
|
|
|
|
|
|
|
|
$this->assertTrue(G::var_compare(true,true,true));
|
|
|
|
|
|
|
|
|
|
$this->assertFalse(G::var_compare(true,true,false));
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::var_probe
|
|
|
|
|
* @todo Implement testVar_probe().
|
|
|
|
|
*/
|
|
|
|
|
public function testVar_probe()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$this->assertEquals(G::var_probe('string'),'string');
|
|
|
|
|
$this->assertEquals(G::var_probe(false,false),1);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::getVersion
|
|
|
|
|
* @todo Implement testGetVersion().
|
|
|
|
|
*/
|
|
|
|
|
public function testGetVersion()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
// @verify
|
|
|
|
|
//$this->assertEquals($valueResponse,'3.0-1');
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::getIpAddress
|
|
|
|
|
* @todo Implement testGetIpAddress().
|
|
|
|
|
*/
|
|
|
|
|
public function testGetIpAddress()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::getMacAddress
|
|
|
|
|
* @todo Implement testGetMacAddress().
|
|
|
|
|
*/
|
|
|
|
|
public function testGetMacAddress()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::microtime_float
|
|
|
|
|
* @todo Implement testMicrotime_float().
|
|
|
|
|
*/
|
|
|
|
|
public function testMicrotime_float()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::setFatalErrorHandler
|
|
|
|
|
* @todo Implement testSetFatalErrorHandler().
|
|
|
|
|
*/
|
|
|
|
|
public function testSetFatalErrorHandler()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::setErrorHandler
|
|
|
|
|
* @todo Implement testSetErrorHandler().
|
|
|
|
|
*/
|
|
|
|
|
public function testSetErrorHandler()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::fatalErrorHandler
|
|
|
|
|
* @todo Implement testFatalErrorHandler().
|
|
|
|
|
*/
|
|
|
|
|
public function testFatalErrorHandler()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::customErrorHandler
|
|
|
|
|
* @todo Implement testCustomErrorHandler().
|
|
|
|
|
*/
|
|
|
|
|
public function testCustomErrorHandler()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::showErrorSource
|
|
|
|
|
* @todo Implement testShowErrorSource().
|
|
|
|
|
*/
|
|
|
|
|
public function testShowErrorSource()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::customErrorLog
|
|
|
|
|
* @todo Implement testCustomErrorLog().
|
|
|
|
|
*/
|
|
|
|
|
public function testCustomErrorLog()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::verboseError
|
|
|
|
|
* @todo Implement testVerboseError().
|
|
|
|
|
*/
|
|
|
|
|
public function testVerboseError()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::encrypt
|
|
|
|
|
* @todo Implement testEncrypt().
|
|
|
|
|
*/
|
|
|
|
|
public function testEncrypt()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$encryptPassword = '6czY7OLU688';
|
|
|
|
|
$encryptResponse = G::encrypt('password','key');
|
|
|
|
|
$this->assertEquals($encryptResponse, $encryptPassword);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::decrypt
|
|
|
|
|
* @todo Implement testDecrypt().
|
|
|
|
|
*/
|
|
|
|
|
public function testDecrypt()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$encryptPassword = 'password';
|
|
|
|
|
$encryptResponse = G::decrypt('6czY7OLU688','key');
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::lookup
|
|
|
|
|
* @todo Implement testLookup().
|
|
|
|
|
*/
|
|
|
|
|
public function testLookup()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
// @verify function
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::mk_dir
|
|
|
|
|
* @todo Implement testMk_dir().
|
|
|
|
|
*/
|
|
|
|
|
public function testMk_dir()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$newDir = PATH_HOME.'test';
|
|
|
|
|
G::mk_dir($newDir);
|
|
|
|
|
$this->assertTrue(is_dir($newDir));
|
|
|
|
|
if ( is_dir($newDir) )
|
|
|
|
|
{
|
|
|
|
|
rmdir($newDir);
|
|
|
|
|
}
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::rm_dir
|
|
|
|
|
* @todo Implement testRm_dir().
|
|
|
|
|
*/
|
|
|
|
|
public function testRm_dir()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
/*
|
|
|
|
|
*
|
|
|
|
|
*@verify function does not work
|
|
|
|
|
|
|
|
|
|
$newDir = PATH_HOME.'test';
|
|
|
|
|
G::mk_dir($newDir);
|
|
|
|
|
if ( is_dir($newDir) )
|
|
|
|
|
{
|
|
|
|
|
G::rm_dir($newDir);
|
|
|
|
|
$this->assertFalse(is_dir($newDir));
|
|
|
|
|
}
|
|
|
|
|
*/
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::verifyPath
|
|
|
|
|
* @todo Implement testVerifyPath().
|
|
|
|
|
*/
|
|
|
|
|
public function testVerifyPath()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$dirExist = PATH_HOME;
|
|
|
|
|
$this->assertTrue(G::verifyPath($dirExist));
|
|
|
|
|
|
|
|
|
|
$dirNoExist = PATH_HOME.'test';
|
|
|
|
|
if ( is_dir($dirNoExist) ) {
|
|
|
|
|
rmdir($dirNoExist);
|
|
|
|
|
}
|
|
|
|
|
$this->assertFalse(G::verifyPath($dirNoExist));
|
|
|
|
|
|
|
|
|
|
$dirNoExist = PATH_HOME.'test';
|
|
|
|
|
$this->assertFalse(G::verifyPath($dirNoExist,true));
|
|
|
|
|
$this->assertTrue(G::verifyPath($dirNoExist));
|
|
|
|
|
if ( is_dir($dirNoExist) ) {
|
|
|
|
|
rmdir($dirNoExist);
|
|
|
|
|
}
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::expandPath
|
|
|
|
|
* @todo Implement testExpandPath().
|
|
|
|
|
*/
|
|
|
|
|
public function testExpandPath()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$valueResponse = G::expandPath('');
|
|
|
|
|
$this->assertEquals($valueResponse, PATH_CORE);
|
|
|
|
|
|
|
|
|
|
$valueResponse = G::expandPath('test');
|
|
|
|
|
$this->assertEquals($valueResponse, PATH_CORE . "test/");
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::LoadSystem
|
|
|
|
|
* @todo Implement testLoadSystem().
|
|
|
|
|
*/
|
|
|
|
|
public function testLoadSystem()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
G::LoadSystem("controller");
|
|
|
|
|
$this->assertTrue(class_exists('Controller'));
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::LoadSystemExist
|
|
|
|
|
* @todo Implement testLoadSystemExist().
|
|
|
|
|
*/
|
|
|
|
|
public function testLoadSystemExist()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$this->assertTrue(G::LoadSystemExist("controller"));
|
|
|
|
|
|
|
|
|
|
$this->assertFalse(G::LoadSystemExist("noExist"));
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::RenderPage
|
|
|
|
|
* @todo Implement testRenderPage().
|
|
|
|
|
*/
|
|
|
|
|
public function testRenderPage()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::LoadSkin
|
|
|
|
|
* @todo Implement testLoadSkin().
|
|
|
|
|
*/
|
|
|
|
|
public function testLoadSkin()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
// @verify useless function
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::LoadInclude
|
|
|
|
|
* @todo Implement testLoadInclude().
|
|
|
|
|
*/
|
|
|
|
|
public function testLoadInclude()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$this->assertTrue( G::LoadInclude('application') && class_exists('App') );
|
|
|
|
|
|
|
|
|
|
$this->assertTrue( G::LoadInclude('ajax') && function_exists('ajax_show_menu'));
|
|
|
|
|
|
|
|
|
|
$this->assertFalse( G::LoadInclude('test') );
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::LoadAllModelClasses
|
|
|
|
|
* @todo Implement testLoadAllModelClasses().
|
|
|
|
|
*/
|
|
|
|
|
public function testLoadAllModelClasses()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::LoadAllPluginModelClasses
|
|
|
|
|
* @todo Implement testLoadAllPluginModelClasses().
|
|
|
|
|
*/
|
|
|
|
|
public function testLoadAllPluginModelClasses()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::LoadTemplate
|
|
|
|
|
* @todo Implement testLoadTemplate().
|
|
|
|
|
*/
|
|
|
|
|
public function testLoadTemplate()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::LoadClassRBAC
|
|
|
|
|
* @todo Implement testLoadClassRBAC().
|
|
|
|
|
*/
|
|
|
|
|
public function testLoadClassRBAC()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
/*
|
|
|
|
|
* @verify useless function
|
|
|
|
|
*/
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::LoadClass
|
|
|
|
|
* @todo Implement testLoadClass().
|
|
|
|
|
*/
|
|
|
|
|
public function testLoadClass()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
G::LoadClass('cli');
|
|
|
|
|
$this->assertTrue(class_exists('CLI'));
|
|
|
|
|
|
|
|
|
|
G::LoadClass('rbac');
|
|
|
|
|
$this->assertTrue(class_exists('RBAC'));
|
|
|
|
|
|
|
|
|
|
$this->assertFalse(G::LoadClass('noExist'));
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::LoadThirdParty
|
|
|
|
|
* @todo Implement testLoadThirdParty().
|
|
|
|
|
*/
|
|
|
|
|
public function testLoadThirdParty()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
G::LoadThirdParty('lime','lime');
|
|
|
|
|
$this->assertTrue(class_exists('lime_test'));
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::encryptlink
|
|
|
|
|
* @todo Implement testEncryptlink().
|
|
|
|
|
*/
|
|
|
|
|
public function testEncryptlink()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$this->assertEquals(G::encryptlink('url'),'url');
|
|
|
|
|
|
|
|
|
|
define('ENABLE_ENCRYPT', 'yes');
|
|
|
|
|
$urlEncrypt = 'qNWc';
|
|
|
|
|
$this->assertEquals(G::encryptlink('url'),$urlEncrypt);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::parseURI
|
|
|
|
|
* @todo Implement testParseURI().
|
|
|
|
|
*/
|
|
|
|
|
public function testParseURI()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::strip_slashes
|
|
|
|
|
* @todo Implement testStrip_slashes().
|
|
|
|
|
*/
|
|
|
|
|
public function testStrip_slashes()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$stringTest = 'h\e\l\l\o';
|
|
|
|
|
$this->assertEquals(G::strip_slashes($stringTest),'hello');
|
|
|
|
|
|
|
|
|
|
$arrayTest = array('h\e\l\l\o', 'h\i' , 't\e\s\t');
|
|
|
|
|
$arrayResponse = G::strip_slashes($arrayTest);
|
|
|
|
|
$this->assertEquals($arrayResponse['0'],'hello');
|
|
|
|
|
$this->assertEquals($arrayResponse['1'],'hi');
|
|
|
|
|
$this->assertEquals($arrayResponse['2'],'test');
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::logTimeByPage
|
|
|
|
|
* @todo Implement testLogTimeByPage().
|
|
|
|
|
*/
|
|
|
|
|
public function testLogTimeByPage()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::streamCSSBigFile
|
|
|
|
|
* @todo Implement testStreamCSSBigFile().
|
|
|
|
|
*/
|
|
|
|
|
public function testStreamCSSBigFile()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::streamJSTranslationFile
|
|
|
|
|
* @todo Implement testStreamJSTranslationFile().
|
|
|
|
|
*/
|
|
|
|
|
public function testStreamJSTranslationFile()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::streamFile
|
|
|
|
|
* @todo Implement testStreamFile().
|
|
|
|
|
*/
|
|
|
|
|
public function testStreamFile()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::trimSourceCodeFile
|
|
|
|
|
* @todo Implement testTrimSourceCodeFile().
|
|
|
|
|
*/
|
|
|
|
|
public function testTrimSourceCodeFile()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::sendHeaders
|
|
|
|
|
* @todo Implement testSendHeaders().
|
|
|
|
|
*/
|
|
|
|
|
public function testSendHeaders()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::virtualURI
|
|
|
|
|
* @todo Implement testVirtualURI().
|
|
|
|
|
*/
|
|
|
|
|
public function testVirtualURI()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::createUID
|
|
|
|
|
* @todo Implement testCreateUID().
|
|
|
|
|
*/
|
|
|
|
|
public function testCreateUID()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$uidTest001 = 'cDhpajRHQ2paUQ______';
|
|
|
|
|
$responseUID = G::createUID('test','001');
|
|
|
|
|
$this->assertEquals($responseUID, $uidTest001);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::getUIDName
|
|
|
|
|
* @todo Implement testGetUIDName().
|
|
|
|
|
*/
|
|
|
|
|
public function testGetUIDName()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$uidTest001 = 'cDhpajRHQ2paUQ______';
|
|
|
|
|
$responseUID = G::getUIDName($uidTest001);
|
|
|
|
|
$this->assertEquals($responseUID, 'test'.'001');
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::formatNumber
|
|
|
|
|
* @todo Implement testFormatNumber().
|
|
|
|
|
*/
|
|
|
|
|
public function testFormatNumber()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$valueNum = 100;
|
|
|
|
|
$responseNum = G::formatNumber($valueNum);
|
|
|
|
|
$this->assertEquals($valueNum, $responseNum);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::formatDate
|
|
|
|
|
* @todo Implement testFormatDate().
|
|
|
|
|
*/
|
|
|
|
|
public function testFormatDate()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
/*
|
|
|
|
|
* @verify function does not return the correct value in the variable F
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
$valueFormatDate = Date('d j F m n y Y g G h H i s');
|
|
|
|
|
$stringDate = G::formatDate(Date("Y-m-d H:i:s"), 'd j F m n y Y g G h H i s', 'es');
|
|
|
|
|
//$this->assertEquals($valueFormatDate, $responseNum);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::getformatedDate
|
|
|
|
|
* @todo Implement testGetformatedDate().
|
|
|
|
|
*/
|
|
|
|
|
public function testGetformatedDate()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
/*
|
|
|
|
|
* @verify function does not return the correct value in the variable F
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
$valueFormatDate = Date('d j F m n y Y g G h H i s');
|
|
|
|
|
$stringDate = G::formatDate(Date("Y-m-d H:i:s"), 'd j F m n y Y g G h H i s', 'es');
|
|
|
|
|
//$this->assertEquals($valueFormatDate, $responseNum);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::arrayDiff
|
|
|
|
|
* @todo Implement testArrayDiff().
|
|
|
|
|
*/
|
|
|
|
|
public function testArrayDiff()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$arrayValues1 = array('value1', 'value2', 'value3', 'value4', 'value5', 'value6', 'value7', 'value8');
|
|
|
|
|
$arrayValues2 = array('value1', 'value2', 'value3', 'value4');
|
|
|
|
|
$arrayRes = G::arrayDiff($arrayValues1, $arrayValues2);
|
|
|
|
|
|
|
|
|
|
$this->assertEquals($arrayRes['0'], 'value5');
|
|
|
|
|
$this->assertEquals($arrayRes['1'], 'value6');
|
|
|
|
|
$this->assertEquals($arrayRes['2'], 'value7');
|
|
|
|
|
$this->assertEquals($arrayRes['3'], 'value8');
|
|
|
|
|
|
|
|
|
|
$arrayRes = G::arrayDiff($arrayValues2, $arrayValues1);
|
|
|
|
|
|
|
|
|
|
$this->assertEquals(count($arrayRes), 0);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::complete_field
|
|
|
|
|
* @todo Implement testComplete_field().
|
|
|
|
|
*/
|
|
|
|
|
public function testComplete_field()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$intTest1 = 145;
|
|
|
|
|
$valueResponse = G::complete_field($intTest1, 3, 1);
|
|
|
|
|
$this->assertEquals($valueResponse, '145');
|
|
|
|
|
|
|
|
|
|
$intTest1 = 145;
|
|
|
|
|
$valueResponse = G::complete_field($intTest1, 5, 1);
|
|
|
|
|
$this->assertEquals($valueResponse, '00145');
|
|
|
|
|
|
|
|
|
|
$intTest1 = 'test';
|
|
|
|
|
$valueResponse = G::complete_field($intTest1, 3, 2);
|
|
|
|
|
$this->assertEquals($valueResponse, 'test');
|
|
|
|
|
|
|
|
|
|
$intTest1 = 'test';
|
|
|
|
|
$valueResponse = G::complete_field($intTest1, 8, 2);
|
|
|
|
|
$this->assertEquals($valueResponse, ' test');
|
|
|
|
|
|
|
|
|
|
$intTest1 = 541;
|
|
|
|
|
$valueResponse = G::complete_field($intTest1, 3, 2);
|
|
|
|
|
$this->assertEquals($valueResponse, '541.');
|
|
|
|
|
|
|
|
|
|
$intTest1 = 541;
|
|
|
|
|
$valueResponse = G::complete_field($intTest1, 5, 2);
|
|
|
|
|
$this->assertEquals($valueResponse, '00541.');
|
|
|
|
|
|
|
|
|
|
$intTest1 = 541.45;
|
|
|
|
|
$valueResponse = G::complete_field($intTest1, 3, 2);
|
|
|
|
|
$this->assertEquals($valueResponse, '541.45');
|
|
|
|
|
|
|
|
|
|
$intTest1 = 541.45;
|
|
|
|
|
$valueResponse = G::complete_field($intTest1, 5, 2);
|
|
|
|
|
$this->assertEquals($valueResponse, '00541.45');
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::sqlEscape
|
|
|
|
|
* @todo Implement testSqlEscape().
|
|
|
|
|
*/
|
|
|
|
|
public function testSqlEscape()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::MySQLSintaxis
|
|
|
|
|
* @todo Implement testMySQLSintaxis().
|
|
|
|
|
*/
|
|
|
|
|
public function testMySQLSintaxis()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
define('DB_ADAPTER', 'mysql');
|
|
|
|
|
$this->assertTrue(G::MySQLSintaxis());
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::replaceDataField
|
|
|
|
|
* @todo Implement testReplaceDataField().
|
|
|
|
|
*/
|
|
|
|
|
public function testReplaceDataField()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::loadLanguageFile
|
|
|
|
|
* @todo Implement testLoadLanguageFile().
|
|
|
|
|
*/
|
|
|
|
|
public function testLoadLanguageFile()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::registerLabel
|
|
|
|
|
* @todo Implement testRegisterLabel().
|
|
|
|
|
*/
|
|
|
|
|
public function testRegisterLabel()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::LoadMenuXml
|
|
|
|
|
* @todo Implement testLoadMenuXml().
|
|
|
|
|
*/
|
|
|
|
|
public function testLoadMenuXml()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::SendMessageXml
|
|
|
|
|
* @todo Implement testSendMessageXml().
|
|
|
|
|
*/
|
|
|
|
|
public function testSendMessageXml()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::SendTemporalMessage
|
|
|
|
|
* @todo Implement testSendTemporalMessage().
|
|
|
|
|
*/
|
|
|
|
|
public function testSendTemporalMessage()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::SendMessage
|
|
|
|
|
* @todo Implement testSendMessage().
|
|
|
|
|
*/
|
|
|
|
|
public function testSendMessage()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::SendMessageText
|
|
|
|
|
* @todo Implement testSendMessageText().
|
|
|
|
|
*/
|
|
|
|
|
public function testSendMessageText()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::LoadMessage
|
|
|
|
|
* @todo Implement testLoadMessage().
|
|
|
|
|
*/
|
|
|
|
|
public function testLoadMessage()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::LoadXmlLabel
|
|
|
|
|
* @todo Implement testLoadXmlLabel().
|
|
|
|
|
*/
|
|
|
|
|
public function testLoadXmlLabel()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$response = 'xxxxxx';
|
|
|
|
|
$this->assertEquals(G::LoadXmlLabel('test'),'xxxxxx');
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::LoadMessageXml
|
|
|
|
|
* @todo Implement testLoadMessageXml().
|
|
|
|
|
*/
|
|
|
|
|
public function testLoadMessageXml()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::LoadTranslationObject
|
|
|
|
|
* @todo Implement testLoadTranslationObject().
|
|
|
|
|
*/
|
|
|
|
|
public function testLoadTranslationObject()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::LoadTranslation
|
|
|
|
|
* @todo Implement testLoadTranslation().
|
|
|
|
|
*/
|
|
|
|
|
public function testLoadTranslation()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::getTranslations
|
|
|
|
|
* @todo Implement testGetTranslations().
|
|
|
|
|
*/
|
|
|
|
|
public function testGetTranslations()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::LoadArrayFile
|
|
|
|
|
* @todo Implement testLoadArrayFile().
|
2012-05-15 09:39:13 -04:00
|
|
|
*/
|
|
|
|
|
public function testLoadArrayFile()
|
|
|
|
|
{
|
|
|
|
|
$this->assertEquals(G::LoadArrayFile(),null);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::expandUri
|
|
|
|
|
* @todo Implement testExpandUri().
|
|
|
|
|
*/
|
|
|
|
|
public function testExpandUri()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::genericForceLogin
|
|
|
|
|
* @todo Implement testGenericForceLogin().
|
|
|
|
|
*/
|
|
|
|
|
public function testGenericForceLogin()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::capitalize
|
|
|
|
|
* @todo Implement testCapitalize().
|
|
|
|
|
*/
|
|
|
|
|
public function testCapitalize()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$name = 'brayan';
|
|
|
|
|
$this->assertEquals('Brayan',G::capitalize($name));
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::toUpper
|
|
|
|
|
* @todo Implement testToUpper().
|
|
|
|
|
*/
|
|
|
|
|
public function testToUpper()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$name = 'brayan';
|
|
|
|
|
$this->assertEquals('BRAYAN',G::toUpper($name));
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::toLower
|
|
|
|
|
* @todo Implement testToLower().
|
|
|
|
|
*/
|
|
|
|
|
public function testToLower()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$name = 'BRAYAN';
|
|
|
|
|
$this->assertEquals('brayan',G::toLower($name));
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::http_build_query
|
|
|
|
|
* @todo Implement testHttp_build_query().
|
|
|
|
|
*/
|
|
|
|
|
public function testHttp_build_query()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$response = G::http_build_query(array('valor1','valor2'),'num','val');
|
|
|
|
|
$this->assertEquals('val[num0]=valor1&val[num1]=valor2', $response);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::header
|
|
|
|
|
* @todo Implement testHeader().
|
|
|
|
|
*/
|
|
|
|
|
public function testHeader()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::forceLogin
|
|
|
|
|
* @todo Implement testForceLogin().
|
|
|
|
|
*/
|
|
|
|
|
public function testForceLogin()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::add_slashes
|
|
|
|
|
* @todo Implement testAdd_slashes().
|
|
|
|
|
*/
|
|
|
|
|
public function testAdd_slashes()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
// @verify : function not work
|
|
|
|
|
//$response = G::add_slashes('path\\dirc');
|
|
|
|
|
//$this->assertEquals($response,'\\test\\ ');
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::uploadFile
|
|
|
|
|
* @todo Implement testUploadFile().
|
|
|
|
|
*/
|
|
|
|
|
public function testUploadFile()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::resizeImage
|
|
|
|
|
* @todo Implement testResizeImage().
|
|
|
|
|
*/
|
|
|
|
|
public function testResizeImage()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::array_merges
|
|
|
|
|
* @todo Implement testArray_merges().
|
|
|
|
|
*/
|
|
|
|
|
public function testArray_merges()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$arrayTest1 = array( 'camp1' => 'val1',
|
|
|
|
|
'camp2' => 'val2',
|
|
|
|
|
'camp3' => 'val3',
|
|
|
|
|
'camp4' => 'val4'
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$arrayTest2 = array( 'camp1' => '1',
|
|
|
|
|
'camp2' => '2'
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$arrayResponse = G::array_merges($arrayTest1, $arrayTest2);
|
|
|
|
|
$this->assertEquals($arrayResponse['camp1'],'1');
|
|
|
|
|
$this->assertEquals($arrayResponse['camp2'],'2');
|
|
|
|
|
|
|
|
|
|
$arrayResponse = G::array_merges($arrayTest2, $arrayTest1);
|
|
|
|
|
$this->assertEquals($arrayResponse['camp3'],'val3');
|
|
|
|
|
$this->assertEquals($arrayResponse['camp4'],'val4');
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::array_merge_2
|
|
|
|
|
* @todo Implement testArray_merge_2().
|
|
|
|
|
*/
|
|
|
|
|
public function testArray_merge_2()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$arrayTest1 = array( 'camp1' => 'val1',
|
|
|
|
|
'camp2' => 'val2',
|
|
|
|
|
'camp3' => 'val3',
|
|
|
|
|
'camp4' => 'val4'
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$arrayTest2 = array( 'camp1' => '1',
|
|
|
|
|
'camp2' => '2'
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
$arrayResponse = G::array_merge_2($arrayTest1, $arrayTest2);
|
|
|
|
|
$this->assertEquals($arrayTest1['camp1'],'1');
|
|
|
|
|
$this->assertEquals($arrayTest1['camp2'],'2');
|
|
|
|
|
|
|
|
|
|
$arrayResponse = G::array_merge_2($arrayTest2, $arrayTest1);
|
|
|
|
|
$this->assertEquals($arrayTest2['camp3'],'val3');
|
|
|
|
|
$this->assertEquals($arrayTest2['camp4'],'val4');
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::generateUniqueID
|
|
|
|
|
* @todo Implement testGenerateUniqueID().
|
|
|
|
|
*/
|
|
|
|
|
public function testGenerateUniqueID()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$uid = G::generateUniqueID();
|
|
|
|
|
$this->assertTrue(is_string($uid) && (strlen($uid) == 32));
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::generateCode
|
|
|
|
|
* @todo Implement testGenerateCode().
|
|
|
|
|
*/
|
|
|
|
|
public function testGenerateCode()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$uid = G::generateCode();
|
|
|
|
|
$this->assertTrue(is_numeric($uid) && (strlen($uid) == 4));
|
|
|
|
|
|
|
|
|
|
$uid = G::generateCode(10);
|
|
|
|
|
$this->assertTrue(is_numeric($uid) && (strlen($uid) == 10));
|
|
|
|
|
|
|
|
|
|
$uid = G::generateCode('ALPHA');
|
|
|
|
|
$this->assertTrue(is_string($uid) && (strlen($uid) == 4));
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::verifyUniqueID
|
|
|
|
|
* @todo Implement testVerifyUniqueID().
|
|
|
|
|
*/
|
|
|
|
|
public function testVerifyUniqueID()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$uid = G::generateUniqueID();
|
|
|
|
|
$response = G::verifyUniqueID($uid);
|
|
|
|
|
$this->assertTrue($response);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::is_utf8
|
|
|
|
|
* @todo Implement testIs_utf8().
|
|
|
|
|
*/
|
|
|
|
|
public function testIs_utf8()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$this->assertTrue(G::is_utf8('árbol'));
|
|
|
|
|
$this->assertTrue(G::is_utf8('árbol'));
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::CurDate
|
|
|
|
|
* @todo Implement testCurDate().
|
|
|
|
|
*/
|
|
|
|
|
public function testCurDate()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$dateNow = Date('Y-m-d H:i:s');
|
|
|
|
|
$this->assertEquals($dateNow,G::CurDate());
|
|
|
|
|
|
|
|
|
|
$dateNow = Date('H:i:s');
|
|
|
|
|
$this->assertEquals($dateNow,G::CurDate('H:i:s'));
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::getSystemConstants
|
|
|
|
|
* @todo Implement testGetSystemConstants().
|
|
|
|
|
*/
|
|
|
|
|
public function testGetSystemConstants()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$response = G::getSystemConstants();
|
|
|
|
|
$this->assertTrue(is_array($response));
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::capitalizeWords
|
|
|
|
|
* @todo Implement testCapitalizeWords().
|
|
|
|
|
*/
|
|
|
|
|
public function testCapitalizeWords()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$response = G::capitalizeWords('brian real');
|
|
|
|
|
$this->assertEquals('Brian Real', $response);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::unhtmlentities
|
|
|
|
|
* @todo Implement testUnhtmlentities().
|
|
|
|
|
*/
|
|
|
|
|
public function testUnhtmlentities()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$response = G::unhtmlentities('árbol');
|
|
|
|
|
$this->assertEquals($response, 'árbol');
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::xmlParser
|
|
|
|
|
* @todo Implement testXmlParser().
|
|
|
|
|
*/
|
|
|
|
|
public function testXmlParser()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
// conchalo : no file xml
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::_del_p
|
|
|
|
|
* @todo Implement test_del_p().
|
|
|
|
|
*/
|
|
|
|
|
public function test_del_p()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::ary2xml
|
|
|
|
|
* @todo Implement testAry2xml().
|
|
|
|
|
*/
|
|
|
|
|
public function testAry2xml()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::ins2ary
|
|
|
|
|
* @todo Implement testIns2ary().
|
|
|
|
|
*/
|
|
|
|
|
public function testIns2ary()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$test = array('value1', 'value2');
|
|
|
|
|
G::ins2ary($test,'newValue',0);
|
|
|
|
|
$this->assertEquals($test['0'],'newValue');
|
|
|
|
|
$this->assertEquals($test['1'],'value1');
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::evalJScript
|
|
|
|
|
* @todo Implement testEvalJScript().
|
|
|
|
|
*/
|
|
|
|
|
public function testEvalJScript()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::inflect
|
|
|
|
|
* @todo Implement testInflect().
|
|
|
|
|
*/
|
|
|
|
|
public function testInflect()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$this->assertEquals( G::inflect('àchélo'), 'achelo');
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::pr
|
|
|
|
|
* @todo Implement testPr().
|
|
|
|
|
*/
|
|
|
|
|
public function testPr()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::dump
|
|
|
|
|
* @todo Implement testDump().
|
|
|
|
|
*/
|
|
|
|
|
public function testDump()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::stripCDATA
|
|
|
|
|
* @todo Implement testStripCDATA().
|
|
|
|
|
*/
|
|
|
|
|
public function testStripCDATA()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$this->assertEquals('value',G::stripCDATA('<![CDATA[value]]>'));
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::sys_get_temp_dir
|
|
|
|
|
* @todo Implement testSys_get_temp_dir().
|
|
|
|
|
*/
|
|
|
|
|
public function testSys_get_temp_dir()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$this->assertEquals('/tmp',G::sys_get_temp_dir());
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::PMWSCompositeResponse
|
|
|
|
|
* @todo Implement testPMWSCompositeResponse().
|
|
|
|
|
*/
|
|
|
|
|
public function testPMWSCompositeResponse()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::emailAddress
|
|
|
|
|
* @todo Implement testEmailAddress().
|
|
|
|
|
*/
|
|
|
|
|
public function testEmailAddress()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$this->assertFalse(G::emailAddress('email'));
|
|
|
|
|
|
|
|
|
|
$response = G::emailAddress('test@email.com');
|
|
|
|
|
$this->assertEquals('test@email.com',$response->email);
|
|
|
|
|
$this->assertEquals('',$response->name);
|
|
|
|
|
|
|
|
|
|
$response = G::emailAddress('Person <test@email.com>');
|
|
|
|
|
//$this->assertEquals('test@email.com',$response->email);
|
|
|
|
|
//$this->assertEquals('',$response->name);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::json_encode
|
|
|
|
|
* @todo Implement testJson_encode().
|
|
|
|
|
*/
|
|
|
|
|
public function testJson_encode()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$arrayTest = array( 'pos1' => 'value1',
|
|
|
|
|
'pos2' => 'value2',
|
|
|
|
|
'pos3' => 'value3',
|
|
|
|
|
);
|
|
|
|
|
$response = G::json_encode($arrayTest);
|
|
|
|
|
$this->assertEquals('{"pos1":"value1","pos2":"value2","pos3":"value3"}',$response);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::json_decode
|
|
|
|
|
* @todo Implement testJson_decode().
|
|
|
|
|
*/
|
|
|
|
|
public function testJson_decode()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$jsonTest = '{"pos1":"value1","pos2":"value2","pos3":"value3"}';
|
|
|
|
|
$response = G::json_decode($jsonTest);
|
|
|
|
|
$this->assertEquals($response->pos1, 'value1');
|
|
|
|
|
$this->assertEquals($response->pos2, 'value2');
|
|
|
|
|
$this->assertEquals($response->pos3, 'value3');
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::isHttpRequest
|
|
|
|
|
* @todo Implement testIsHttpRequest().
|
|
|
|
|
*/
|
|
|
|
|
public function testIsHttpRequest()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$response = G::isHttpRequest();
|
|
|
|
|
$this->assertFalse($response);
|
|
|
|
|
|
|
|
|
|
$_SERVER['SERVER_SOFTWARE'] = 'Apache/2.2.8 (CentOS)';
|
|
|
|
|
$response = G::isHttpRequest();
|
|
|
|
|
$this->assertTrue($response);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::sendMail
|
|
|
|
|
* @todo Implement testSendMail().
|
|
|
|
|
*/
|
|
|
|
|
public function testSendMail()
|
|
|
|
|
{
|
2012-05-17 17:31:48 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::envelopEmailAddresses
|
|
|
|
|
* @todo Implement testEnvelopEmailAddresses().
|
|
|
|
|
*/
|
|
|
|
|
public function testEnvelopEmailAddresses()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$dataAddresses = array( 'to' => 'test1@colosa.com',
|
|
|
|
|
'cc' => array( 'test2@colosa.com <Email Test2>',
|
|
|
|
|
'test3@colosa.com',
|
|
|
|
|
'test4@colosa.com'
|
|
|
|
|
),
|
|
|
|
|
'bcc'=> array( 'test5@colosa.com')
|
|
|
|
|
);
|
|
|
|
|
$response = G::envelopEmailAddresses($dataAddresses);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->assertEquals($response['to']['0']['0'], 'test1@colosa.com');
|
|
|
|
|
/*
|
|
|
|
|
$this->assertEquals($response['cc']['0']['0'], 'test2@colosa.com');
|
|
|
|
|
$this->assertEquals($response['cc']['0']['1'], 'test3@colosa.com');
|
|
|
|
|
$this->assertEquals($response['cc']['0']['2'], 'test4@colosa.com');
|
|
|
|
|
*/
|
|
|
|
|
$this->assertEquals($response['bcc']['0']['0'], 'test5@colosa.com');
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::gettype
|
|
|
|
|
* @todo Implement testGettype().
|
|
|
|
|
*/
|
|
|
|
|
public function testGettype()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$value = NULL;
|
|
|
|
|
//$this->assertEquals(G::gettype($value),'NULL');
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
// function no work with null
|
2012-05-15 09:39:13 -04:00
|
|
|
|
|
|
|
|
$value = true;
|
|
|
|
|
$this->assertEquals(G::gettype($value),'boolean');
|
|
|
|
|
|
|
|
|
|
$value = 15.25;
|
|
|
|
|
$this->assertEquals(G::gettype($value),'double');
|
|
|
|
|
|
|
|
|
|
$value = 142;
|
|
|
|
|
$this->assertEquals(G::gettype($value),'integer');
|
|
|
|
|
|
|
|
|
|
$value = 'string';
|
|
|
|
|
$this->assertEquals(G::gettype($value),'string');
|
|
|
|
|
|
|
|
|
|
$value = array('val1', 'val2');
|
|
|
|
|
$this->assertEquals(G::gettype($value),'array');
|
|
|
|
|
|
|
|
|
|
$value = new stdClass();
|
|
|
|
|
$this->assertEquals(G::gettype($value),'object');
|
|
|
|
|
|
2012-05-16 12:56:14 -04:00
|
|
|
// need conexion BD is_resource
|
2012-05-15 09:39:13 -04:00
|
|
|
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::removeComments
|
|
|
|
|
* @todo Implement testRemoveComments().
|
|
|
|
|
*/
|
|
|
|
|
public function testRemoveComments()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$value = 'code1 /* comment 1 */ code2 code3';
|
|
|
|
|
$response = G::removeComments($value);
|
|
|
|
|
$this->assertEquals('code1 code2 code3',$response);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::getMemoryUsage
|
|
|
|
|
* @todo Implement testGetMemoryUsage().
|
|
|
|
|
*/
|
|
|
|
|
public function testGetMemoryUsage()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$response = G::getMemoryUsage();
|
|
|
|
|
$mb = "Mb";
|
|
|
|
|
$this->assertTrue($response != '' && strpos($response, $mb));
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::getFormatUserList
|
|
|
|
|
* @todo Implement testGetFormatUserList().
|
|
|
|
|
*/
|
|
|
|
|
public function testGetFormatUserList()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$aUserInfo['USR_USERNAME'] = 'fontiveros';
|
|
|
|
|
$aUserInfo['USR_FIRSTNAME'] = 'Fernando';
|
|
|
|
|
$aUserInfo['USR_LASTNAME'] = 'Ontiveros';
|
|
|
|
|
|
|
|
|
|
$response = G::getFormatUserList('@firstName @lastName', $aUserInfo);
|
|
|
|
|
$this->assertEquals('Fernando Ontiveros',$response);
|
|
|
|
|
|
|
|
|
|
$response = G::getFormatUserList('@firstName @lastName (@userName)', $aUserInfo);
|
|
|
|
|
$this->assertEquals('Fernando Ontiveros (fontiveros)',$response);
|
|
|
|
|
|
|
|
|
|
$response = G::getFormatUserList('@userName', $aUserInfo);
|
|
|
|
|
$this->assertEquals('fontiveros',$response);
|
|
|
|
|
|
|
|
|
|
$response = G::getFormatUserList('@userName (@firstName @lastName)', $aUserInfo);
|
|
|
|
|
$this->assertEquals('fontiveros (Fernando Ontiveros)',$response);
|
|
|
|
|
|
|
|
|
|
$response = G::getFormatUserList('@lastName @firstName', $aUserInfo);
|
|
|
|
|
$this->assertEquals('Ontiveros Fernando',$response);
|
|
|
|
|
|
|
|
|
|
$response = G::getFormatUserList('@lastName, @firstName', $aUserInfo);
|
|
|
|
|
$this->assertEquals('Ontiveros, Fernando',$response);
|
|
|
|
|
|
|
|
|
|
$response = G::getFormatUserList('@lastName, @firstName (@userName)', $aUserInfo);
|
|
|
|
|
$this->assertEquals('Ontiveros, Fernando (fontiveros)',$response);
|
|
|
|
|
|
|
|
|
|
$response = G::getFormatUserList('test', $aUserInfo);
|
|
|
|
|
$this->assertEquals('fontiveros',$response);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::getModel
|
|
|
|
|
* @todo Implement testGetModel().
|
|
|
|
|
*/
|
|
|
|
|
public function testGetModel()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
/*
|
|
|
|
|
require_once PATH_TRUNK . 'gulliver' . PATH_SEP . 'thirparty' . PATH_SEP . 'propel' . PATH_SEP . 'Propel.php';
|
|
|
|
|
$model = 'AdditionalTables';
|
|
|
|
|
$additionalTables = G::getModel($model);
|
|
|
|
|
$this->assertTrue(is_object($additionalTables) && class_exists($model));
|
|
|
|
|
*/
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::is_rwritable
|
|
|
|
|
* @todo Implement testIs_rwritable().
|
|
|
|
|
*/
|
|
|
|
|
public function testIs_rwritable()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::rglob
|
|
|
|
|
* @todo Implement testRglob().
|
|
|
|
|
*/
|
|
|
|
|
public function testRglob()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::browser_detection
|
|
|
|
|
* @todo Implement testBrowser_detection().
|
|
|
|
|
*/
|
|
|
|
|
public function testBrowser_detection()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
// $res = G::browser_detection('full_assoc');
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-15 09:39:13 -04:00
|
|
|
// $this->assertEquals(is_array($res));
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::get_os_data
|
|
|
|
|
* @todo Implement testGet_os_data().
|
|
|
|
|
*/
|
|
|
|
|
public function testGet_os_data()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::get_item_version
|
|
|
|
|
* @todo Implement testGet_item_version().
|
|
|
|
|
*/
|
|
|
|
|
public function testGet_item_version()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::get_set_count
|
|
|
|
|
* @todo Implement testGet_set_count().
|
|
|
|
|
*/
|
|
|
|
|
public function testGet_set_count()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$this->assertEquals(G::get_set_count('get'),1);
|
|
|
|
|
$this->assertEquals(G::get_set_count('set',0),'');
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::check_is_mobile
|
|
|
|
|
* @todo Implement testCheck_is_mobile().
|
|
|
|
|
*/
|
|
|
|
|
public function testCheck_is_mobile()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::get_mobile_data
|
|
|
|
|
* @todo Implement testGet_mobile_data().
|
|
|
|
|
*/
|
|
|
|
|
public function testGet_mobile_data()
|
|
|
|
|
{
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::getBrowser
|
|
|
|
|
* @todo Implement testGetBrowser().
|
|
|
|
|
*/
|
|
|
|
|
public function testGetBrowser()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
//$this->assertTrue(is_array(G::getBrowser()));
|
2012-05-16 12:56:14 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::script_time
|
|
|
|
|
* @todo Implement testScript_time().
|
|
|
|
|
*/
|
|
|
|
|
public function testScript_time()
|
|
|
|
|
{
|
|
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::getDirectorySize
|
|
|
|
|
* @todo Implement testGetDirectorySize().
|
|
|
|
|
*/
|
|
|
|
|
public function testGetDirectorySize()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$path = PATH_TRUNK . 'gulliver' . PATH_SEP . "system";
|
|
|
|
|
$response = G::getDirectorySize($path);
|
|
|
|
|
$this->assertTrue(is_array($response) && count($response));
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::getCacheFileNameByPattern
|
|
|
|
|
* @todo Implement testGetCacheFileNameByPattern().
|
|
|
|
|
*/
|
|
|
|
|
public function testGetCacheFileNameByPattern()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$response = G::getCacheFileNameByPattern(PATH_TRUNK . 'gulliver' . PATH_SEP . "system" . PATH_SEP . "class.g.php" ,'');
|
|
|
|
|
$this->assertTrue(is_array($response) && count($response));
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::getCheckSum
|
|
|
|
|
* @todo Implement testGetCheckSum().
|
|
|
|
|
*/
|
|
|
|
|
public function testGetCheckSum()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
$response = G::getCheckSum(PATH_TRUNK . 'gulliver' . PATH_SEP . "system" . PATH_SEP . "class.g.php");
|
|
|
|
|
$this->assertTrue(is_string($response));
|
2012-05-09 10:43:56 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::parse_ini_string
|
|
|
|
|
* @todo Implement testParse_ini_string().
|
|
|
|
|
*/
|
|
|
|
|
public function testParse_ini_string()
|
|
|
|
|
{
|
2012-05-15 09:39:13 -04:00
|
|
|
|
2012-05-09 10:43:56 -04:00
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::disableEnableINIvariable
|
|
|
|
|
* @todo Implement testDisableEnableINIvariable().
|
|
|
|
|
*/
|
|
|
|
|
public function testDisableEnableINIvariable()
|
|
|
|
|
{
|
|
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::setINIvariable
|
|
|
|
|
* @todo Implement testSetINIvariable().
|
|
|
|
|
*/
|
|
|
|
|
public function testSetINIvariable()
|
|
|
|
|
{
|
|
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::write_php_ini
|
|
|
|
|
* @todo Implement testWrite_php_ini().
|
|
|
|
|
*/
|
|
|
|
|
public function testWrite_php_ini()
|
|
|
|
|
{
|
|
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::verifyWriteAccess
|
|
|
|
|
* @todo Implement testVerifyWriteAccess().
|
|
|
|
|
*/
|
|
|
|
|
public function testVerifyWriteAccess()
|
|
|
|
|
{
|
|
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::renderTemplate
|
|
|
|
|
* @todo Implement testRenderTemplate().
|
|
|
|
|
*/
|
|
|
|
|
public function testRenderTemplate()
|
|
|
|
|
{
|
|
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::parseTemplate
|
|
|
|
|
* @todo Implement testParseTemplate().
|
|
|
|
|
*/
|
|
|
|
|
public function testParseTemplate()
|
|
|
|
|
{
|
|
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::update_php_ini
|
|
|
|
|
* @todo Implement testUpdate_php_ini().
|
|
|
|
|
*/
|
|
|
|
|
public function testUpdate_php_ini()
|
|
|
|
|
{
|
|
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers G::is_writable_r
|
|
|
|
|
* @todo Implement testIs_writable_r().
|
|
|
|
|
*/
|
|
|
|
|
public function testIs_writable_r()
|
|
|
|
|
{
|
|
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
'This test has not been implemented yet.'
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|