$className = strtolower(substr($className, 0, 1)) . substr($className, 1); $reflect = new ReflectionClass($className); $method = array(); $testItems = 0; foreach ($reflect->getMethods() as $reflectmethod) { $params = ''; foreach ($reflectmethod->getParameters() as $key => $row) { if ($params != '') { $params .= ', '; } $params .= '$' . $row->name; } $testItems++; $methods[$reflectmethod->getName()] = $params; } //To change the case only the first letter of each word, TIA $className = ucwords($className); $t->diag("class {$className}"); $t->isa_ok($obj, "XMLDB", "class {$className} created"); $t->is(count($methods), 2, "class {$className} have " . 2 . ' methods.'); //checking method 'connect' $t->can_ok($obj, 'connect', 'connect() is callable'); //$result = $obj->connect ( $dsn, $options); //$t->isa_ok( $result, 'NULL', 'call to method connect '); $t->todo("call to method connect using {$dsn}, {$options} "); //checking method 'isError' $t->can_ok($obj, 'isError', 'isError() is callable'); //$result = $obj->isError ( $result); //$t->isa_ok( $result, 'NULL', 'call to method isError '); $t->todo("call to method isError using {$result} "); $t->todo('review all pendings methods in this class');
if ($params != '') { $params .= ', '; } $params .= '$' . $row->name; } $testItems++; $methods[$reflectmethod->getName()] = $params; } //To change the case only the first letter of each word, TIA $className = ucwords($className); $t->diag("class {$className}"); $t->isa_ok($obj, "wsBase", "class {$className} created"); //$t->is( count($methods) , 26, "class $className have " . 26 . ' methods.' ); $t->is(count($methods), 28, "class {$className} have " . 28 . ' methods.'); //checking method '__construct' $t->can_ok($obj, '__construct', '__construct() is callable'); //$result = $obj->__construct ( ); //$t->isa_ok( $result, 'NULL', 'call to method __construct '); $t->todo("call to method __construct using "); //checking method 'login' $t->can_ok($obj, 'login', 'login() is callable'); //$result = $obj->login ( $userid, $password); //$t->isa_ok( $result, 'NULL', 'call to method login '); $t->todo("call to method login using {$userid}, {$password} "); //checking method 'processList' $t->can_ok($obj, 'processList', 'processList() is callable'); //$result = $obj->processList ( ); //$t->isa_ok( $result, 'NULL', 'call to method processList '); $t->todo("call to method processList using "); //checking method 'roleList' $t->can_ok($obj, 'roleList', 'roleList() is callable');
require_once PATH_CORE . "config/databases.php"; G::LoadClass('languages'); $obj = new Languages($dbc); $t = new lime_test(5, new lime_output_color()); $className = Languages; $className = strtolower(substr($className, 0, 1)) . substr($className, 1); $reflect = new ReflectionClass($className); $method = array(); $testItems = 0; foreach ($reflect->getMethods() as $reflectmethod) { $params = ''; foreach ($reflectmethod->getParameters() as $key => $row) { if ($params != '') { $params .= ', '; } $params .= '$' . $row->name; } $testItems++; $methods[$reflectmethod->getName()] = $params; } //To change the case only the first letter of each word, TIA $className = ucwords($className); $t->diag("class {$className}"); $t->isa_ok($obj, "languages", "class {$className} created"); $t->is(count($methods), 1, "class {$className} have " . 1 . ' methods.'); //checking method 'importLanguage' $t->can_ok($obj, 'importLanguage', 'importLanguage() is callable'); //$result = $obj->importLanguage ( $sLanguageFile, $bXml); //$t->isa_ok( $result, 'NULL', 'call to method importLanguage '); $t->todo("call to method importLanguage using {$sLanguageFile}, {$bXml} "); $t->todo('review all pendings methods in this class');
Propel::init(PATH_CORE . 'config/databases.php'); G::LoadThirdParty('smarty/libs', 'Smarty.class'); G::LoadSystem('error'); G::LoadSystem('xmlform'); G::LoadSystem('xmlDocument'); G::LoadSystem('form'); G::LoadSystem('dbtable'); G::LoadSystem('testTools'); require_once PATH_CORE . 'classes/model/SwimlanesElements.php'; $obj = new SwimlanesElements(); $t = new lime_test(7, new lime_output_color()); $t->diag('Class SwimlanesElements'); //class SwimlanesElements $t->isa_ok($obj, 'SwimlanesElements', 'Class SwimlanesElements created!'); //method load $t->can_ok($obj, 'load', 'load() is callable!'); //method create $t->can_ok($obj, 'create', 'create() is callable!'); //method update $t->can_ok($obj, 'update', 'update() is callable!'); //method remove $t->can_ok($obj, 'remove', 'remove() is callable!'); //method getSwiEleText $t->can_ok($obj, 'getSwiEleText', 'getSwiEleText() is callable!'); //method setSwiEleText $t->can_ok($obj, 'setSwiEleText', 'setSwiEleText() is callable!'); /***** TEST CLASS SWIMLANESELEMENTS *****/ ///////// INITIAL VALUES ///////// define('SYS_LANG', 'en'); //Test class class SwimlanesElementsTest extends unitTest
exit(201); } G::LoadThirdParty('pear/json', 'class.json'); G::LoadThirdParty('smarty/libs', 'Smarty.class'); G::LoadSystem('xmlform'); G::LoadSystem('xmlDocument'); G::LoadSystem('form'); G::LoadSystem('xmlDocument'); $t = new lime_test(11, new lime_output_color()); $obj = new Xml_Node('name', 'type', 'value'); $method = array(); $testItems = 0; $class_methods = get_class_methods('Xml_Node'); foreach ($class_methods as $method_name) { $methods[$testItems] = $method_name; $testItems++; } $t->diag('class Xml_Node'); $t->is($testItems, 8, "class Xml_Node " . $testItems . " methods."); $t->isa_ok($obj, 'Xml_Node', 'class Xml_Node created'); $t->can_ok($obj, 'addAttribute', 'addAttribute()'); $t->can_ok($obj, 'addChildNode', 'addChildNode()'); $t->can_ok($obj, 'toTree', 'toTree()'); $t->can_ok($obj, 'findNode', 'findNode()'); $t->can_ok($obj, 'getXML', 'getXML()'); $obj = new Xml_document('name', 'type', 'value'); $t->diag('class Xml_document'); $t->isa_ok($obj, 'Xml_document', 'class Xml_document created'); $t->can_ok($obj, 'parseXmlFile', 'parseXmlFile()'); $t->can_ok($obj, 'getXML', 'getXML()'); $t->todo('review all pendings in this class');
* */ if (!defined('PATH_THIRDPARTY')) { require_once $_SERVER['PWD'] . '/test/bootstrap/unit.php'; } require_once PATH_THIRDPARTY . 'lime/lime.php'; define('G_ENVIRONMENT', G_TEST_ENV); G::LoadThirdParty('smarty/libs', 'Smarty.class'); G::LoadSystem('xmlform'); G::LoadSystem('xmlDocument'); G::LoadSystem('form'); G::LoadSystem('database_base'); $counter = 1; $t = new lime_test(12, new lime_output_color()); $obj = new database_base(); $methods = get_class_methods('database_base'); $t->diag('class database_base'); /* Listing Method */ $t->isa_ok($obj, 'database_base', 'class database_base created'); $t->todo('Listing Method'); $t->is(count($methods), 8, "class database_base " . count($methods) . " methods."); /* checking methods */ $t->can_ok($obj, '__construct', $counter++ . ' __construct()'); $t->can_ok($obj, 'generateDropTableSQL', $counter++ . ' generateDropTableSQL()'); $t->can_ok($obj, 'generateCreateTableSQL', $counter++ . ' generateCreateTableSQL()'); $t->can_ok($obj, 'generateDropColumnSQL', $counter++ . ' generateDropColumnSQL()'); $t->can_ok($obj, 'generateAddColumnSQL', $counter++ . ' generateAddColumnSQL()'); $t->can_ok($obj, 'generateChangeColumnSQL', $counter++ . ' generateChangeColumnSQL()'); $t->can_ok($obj, 'executeQuery', $counter++ . ' executeQuery()'); $t->can_ok($obj, 'close', $counter++ . ' close()'); $t->todo('Review, specific examples.');
foreach ($reflect->getMethods() as $reflectmethod) { $params = ''; foreach ($reflectmethod->getParameters() as $key => $row) { if ($params != '') { $params .= ', '; } $params .= '$' . $row->name; } $testItems++; $methods[$reflectmethod->getName()] = $params; } $t->diag('class $className'); $t->isa_ok($obj, 'Jrml', 'class $className created'); $t->is(count($methods), 8, "class {$className} have " . 8 . ' methods.'); //checking method '__construct' $t->can_ok($obj, '__construct', '__construct() is callable'); //$result = $obj->__construct ( $data); //$t->isa_ok( $result, 'NULL', 'call to method __construct '); $t->todo("call to method __construct using {$data} "); //checking method 'get_rows' $t->can_ok($obj, 'get_rows', 'get_rows() is callable'); //$result = $obj->get_rows ( $a); //$t->isa_ok( $result, 'NULL', 'call to method get_rows '); $t->todo("call to method get_rows using {$a} "); //checking method 'get_md' $t->can_ok($obj, 'get_md', 'get_md() is callable'); //$result = $obj->get_md ( ); //$t->isa_ok( $result, 'NULL', 'call to method get_md '); $t->todo("call to method get_md using "); //checking method 'get_header' $t->can_ok($obj, 'get_header', 'get_header() is callable');
$testItems = 0; foreach ($reflect->getMethods() as $reflectmethod) { $params = ''; foreach ($reflectmethod->getParameters() as $key => $row) { if ($params != '') { $params .= ', '; } $params .= '$' . $row->name; } $testItems++; $methods[$reflectmethod->getName()] = $params; } $t->diag('class $className'); $t->isa_ok($obj, $className, 'class $className created'); $t->is(count($methods), 3, "class {$className} have " . 3 . ' methods.'); //checking method '__construct' $t->can_ok($obj, '__construct', '__construct() is callable'); //$result = $obj->__construct ( $status, $message); //$t->isa_ok( $result, 'NULL', 'call to method __construct '); $t->todo("call to method __construct using {$status}, {$message} "); //checking method 'getPayloadString' $t->can_ok($obj, 'getPayloadString', 'getPayloadString() is callable'); //$result = $obj->getPayloadString ( $operation); //$t->isa_ok( $result, 'NULL', 'call to method getPayloadString '); $t->todo("call to method getPayloadString using {$operation} "); //checking method 'getPayloadArray' $t->can_ok($obj, 'getPayloadArray', 'getPayloadArray() is callable'); //$result = $obj->getPayloadArray ( ); //$t->isa_ok( $result, 'NULL', 'call to method getPayloadArray '); $t->todo("call to method getPayloadArray using "); $t->todo('review all pendings methods in this class');
$params = ''; foreach ($reflectmethod->getParameters() as $key => $row) { if ($params != '') { $params .= ', '; } $params .= '$' . $row->name; } $testItems++; $methods[$reflectmethod->getName()] = $params; } //To change the case only the first letter of each word, TIA //$className = ucwords($className); $t->diag("class {$className}"); $t->isa_ok($obj, $className, "class {$className} created"); $t->is(count($methods), 3, "class {$className} have " . 3 . ' methods.'); //checking method '__construct' $t->can_ok($obj, '__construct', '__construct() is callable'); //$result = $obj->__construct ( $db_spool); //$t->isa_ok( $result, 'NULL', 'call to method __construct '); $t->todo("call to method __construct using {$db_spool} "); //checking method 'returnStatus' $t->can_ok($obj, 'returnStatus', 'returnStatus() is callable'); //$result = $obj->returnStatus ( ); //$t->isa_ok( $result, 'NULL', 'call to method returnStatus '); $t->todo("call to method returnStatus using "); //checking method 'db_insert' $t->can_ok($obj, 'db_insert', 'db_insert() is callable'); //$result = $obj->db_insert ( $db_spool); //$t->isa_ok( $result, 'NULL', 'call to method db_insert '); $t->todo("call to method db_insert using {$db_spool} "); $t->todo('review all pendings methods in this class');
global $G_ENVIRONMENTS; if (isset($G_ENVIRONMENTS)) { $dbfile = $G_ENVIRONMENTS[G_TEST_ENV]['dbfile']; if (!file_exists($dbfile)) { printf("%s \n", pakeColor::colorize("dbfile {$dbfile} doesn't exist for environment " . G_ENVIRONMENT, 'ERROR')); exit(200); } else { include $dbfile; } } else { exit(201); } require_once PATH_GULLIVER . 'class.dbconnection.php'; require_once PATH_GULLIVER . 'class.dbsession.php'; require_once PATH_GULLIVER . 'class.dbrecordset.php'; $dbc = new DBConnection(); $ses = new DBSession($dbc); $dset = $ses->Execute("SELECT * from APPLICATION"); $method = array(); $testItems = 0; $methods = get_class_methods('DBRecordSet'); $t = new lime_test(8, new lime_output_color()); $t->diag('class DBRecordset'); $t->is(count($methods), 6, "class G " . count($methods) . " methods."); $t->isa_ok($dset, 'DBRecordSet', 'class DBRecordset created'); $t->can_ok($dset, 'SetTo', 'SetTo()'); $t->can_ok($dset, 'Free', 'Free()'); $t->can_ok($dset, 'Count', 'Count()'); $t->can_ok($dset, 'Read', 'Read()'); $t->can_ok($dset, 'ReadAbsolute', 'ReadAbsolute()'); $t->todo('review all pendings in this class');
} } else { exit(201); } G::LoadThirdParty('pear/json', 'class.json'); G::LoadThirdParty('smarty/libs', 'Smarty.class'); G::LoadSystem('xmlform'); G::LoadSystem('xmlDocument'); G::LoadSystem('form'); G::LoadSystem('menu'); $obj = new Menu(); $counter = 1; $method = get_class_methods('Menu'); print_r($class_methods); $t = new lime_test(15, new lime_output_color()); $t->diag('class Menu'); $t->is(count($method), 11, "class Menu " . count($method) . " methods."); $t->isa_ok($obj, 'Menu', 'class Menu created'); $t->can_ok($obj, 'SetClass', $counter++ . ' SetClass()'); $t->can_ok($obj, 'Load', $counter++ . ' Load()'); $t->can_ok($obj, 'OptionCount', $counter++ . ' OptionCount()'); $t->can_ok($obj, 'AddOption', $counter++ . ' AddOption()'); $t->can_ok($obj, 'AddIdOption', $counter++ . ' AddIdOption()'); $t->can_ok($obj, 'AddRawOption', $counter++ . ' AddRawOption()'); $t->can_ok($obj, 'AddIdRawOption', $counter++ . ' AddIdRawOption()'); $t->can_ok($obj, 'DisableOptionPos', $counter++ . ' DisableOptionPos()'); $t->can_ok($obj, 'DisableOptionId', $counter++ . ' DisableOptionId()'); $t->can_ok($obj, 'RenderOption', $counter++ . ' RenderOption()'); $t->can_ok($obj, 'generateArrayForTemplate', $counter++ . ' generateArrayForTemplate()'); $t->is(count($method), --$counter, " methods "); $t->todo('review all pendings in this class');
printf("%s \n", pakeColor::colorize("dbfile {$dbfile} doesn't exist for environment " . G_ENVIRONMENT, 'ERROR')); exit(200); } else { include $dbfile; } } else { exit(201); } G::LoadThirdParty('pear/json', 'class.json'); G::LoadThirdParty('smarty/libs', 'Smarty.class'); G::LoadSystem('xmlform'); G::LoadSystem('xmlDocument'); G::LoadSystem('form'); G::LoadSystem('tree'); $t = new lime_test(7, new lime_output_color()); $obj = new Tree(array('name' => 'value')); $method = array(); $testItems = 0; $class_methods = get_class_methods('Tree'); foreach ($class_methods as $method_name) { $methods[$testItems] = $method_name; $testItems++; } $t->diag('class Tree'); $t->is($testItems, 14, "class Tree " . $testItems . " methods."); $t->isa_ok($obj, 'Tree', 'class Tree created'); $t->can_ok($obj, 'addChild', 'addChild()'); $t->can_ok($obj, 'printPlus', 'printPlus()'); $t->can_ok($obj, 'printContent', 'printContent()'); $t->can_ok($obj, 'render', 'render()'); $t->todo('review all pendings in this class');
Propel::init(PATH_CORE . 'config/databases.php'); G::LoadThirdParty('smarty/libs', 'Smarty.class'); G::LoadSystem('error'); G::LoadSystem('xmlform'); G::LoadSystem('xmlDocument'); G::LoadSystem('form'); G::LoadSystem('dbtable'); G::LoadSystem('testTools'); require_once PATH_CORE . 'classes/model/Route.php'; $obj = new Route(); $t = new lime_test(13, new lime_output_color()); $t->diag('Class Route'); //class Route $t->isa_ok($obj, 'Route', 'Class Route created!'); //method load $t->can_ok($obj, 'load', 'load() is callable!'); //method create $t->can_ok($obj, 'create', 'create() is callable!'); //method update $t->can_ok($obj, 'update', 'update() is callable!'); //method remove $t->can_ok($obj, 'remove', 'remove() is callable!'); /***** TEST CLASS ROUTE *****/ ///////// INITIAL VALUES ///////// define('SYS_LANG', 'en'); //Test class class RouteTest extends unitTest { function loadTest($aTestData, $aFields) { $oRoute = new Route();
global $G_ENVIRONMENTS; if (isset($G_ENVIRONMENTS)) { $dbfile = $G_ENVIRONMENTS[G_TEST_ENV]['dbfile']; if (!file_exists($dbfile)) { printf("%s \n", pakeColor::colorize("dbfile {$dbfile} doesn't exist for environment " . G_ENVIRONMENT, 'ERROR')); exit(200); } else { include $dbfile; } } else { exit(201); } G::LoadThirdParty('pear/json', 'class.json'); G::LoadThirdParty('smarty/libs', 'Smarty.class'); G::LoadSystem('xmlform'); G::LoadSystem('xmlDocument'); G::LoadSystem('form'); G::LoadSystem('rbac'); $method = array(); $method = get_class_methods('RBAC'); $t = new lime_test(8, new lime_output_color()); $obj =& RBAC::getSingleton(); $t->diag('class RBAC'); $t->is(count($method), 46, "class RBAC " . count($method) . " methods."); $t->isa_ok($obj, 'RBAC', 'class RBAC created'); $t->can_ok($obj, 'VerifyLogin', 'VerifyLogin()'); $t->can_ok($obj, 'userCanAccess', 'userCanAccess()'); $t->can_ok($obj, 'load', 'load()'); $t->can_ok($obj, 'createUser', 'createUser()'); $t->can_ok($obj, 'listAllRoles', 'listAllRoles()'); $t->todo('review all pendings in this class');
G::LoadSystem('dbconnection'); G::LoadSystem('dbsession'); G::LoadSystem('dbrecordset'); G::LoadSystem('dbtable'); G::LoadSystem('testTools'); //G::LoadClass ( 'task'); require_once PATH_CORE . '/classes/model/Task.php'; require_once PATH_CORE . "config/databases.php"; $dbc = new DBConnection(); $ses = new DBSession($dbc); $obj = new Task($dbc); $t = new lime_test(11, new lime_output_color()); $t->diag('class Task'); $t->isa_ok($obj, 'Task', 'class Task created'); //method load $t->can_ok($obj, 'load', 'load() is callable'); //method save $t->can_ok($obj, 'update', 'update() is callable'); //method delete $t->can_ok($obj, 'delete', 'delete() is callable'); //method create $t->can_ok($obj, 'create', 'create() is callable'); class TaskTest extends UnitTest { function CreateTask($data, $fields) { try { $task = new Task(); $result = $task->create($fields); $this->domain->addDomainValue('CREATED', $task->getTasUid()); return $result;
require_once 'propel/Propel.php'; Propel::init(PATH_CORE . "config/databases.php"); G::LoadThirdParty('smarty/libs', 'Smarty.class'); G::LoadSystem('error'); G::LoadSystem('xmlform'); G::LoadSystem('xmlDocument'); G::LoadSystem('form'); G::LoadSystem('testTools'); require_once PATH_CORE . '/classes/model/Dynaform.php'; $obj = new Dynaform(); $t = new lime_test(18, new lime_output_color()); $t->diag('class Dynaform'); $t->isa_ok($obj, 'Dynaform', 'class Dynaform created'); //method load //#2 $t->can_ok($obj, 'getDynTitle', 'getDynTitle() is callable'); //#3 $t->can_ok($obj, 'setDynTitle', 'setDynTitle() is callable'); //#4 $t->can_ok($obj, 'getDynDescription', 'getDynDescription() is callable'); //#5 $t->can_ok($obj, 'setDynDescription', 'setDynDescription() is callable'); //#6 $t->can_ok($obj, 'create', 'create() is callable'); //#7 $t->can_ok($obj, 'update', 'update() is callable'); //#8 $t->can_ok($obj, 'load', 'load() is callable'); //#9 $t->can_ok($obj, 'remove', 'remove() is callable'); //getDynUid
foreach ($reflectmethod->getParameters() as $key => $row) { if ($params != '') { $params .= ', '; } $params .= '$' . $row->name; } $testItems++; $methods[$reflectmethod->getName()] = $params; } //To change the case only the first letter of each word, TIA //$className = ucwords($className); $t->diag("class {$className}"); $t->isa_ok($obj, $className, "class {$className} created"); $t->is(count($methods), 17, "class {$className} have " . 17 . ' methods.'); //checking method 'calculateDate' $t->can_ok($obj, 'calculateDate', 'calculateDate() is callable'); //$result = $obj->calculateDate ( $sInitDate, $iDuration, $sTimeUnit, $iTypeDay, $UsrUid, $ProUid, $TasUid); //$t->isa_ok( $result, 'NULL', 'call to method calculateDate '); $t->todo("call to method calculateDate using {$sInitDate}, {$iDuration}, {$sTimeUnit}, {$iTypeDay}, {$UsrUid}, {$ProUid}, {$TasUid} "); //checking method 'calculateDuration' $t->can_ok($obj, 'calculateDuration', 'calculateDuration() is callable'); //$result = $obj->calculateDuration ( $sInitDate, $sEndDate, $UsrUid, $ProUid, $TasUid); //$t->isa_ok( $result, 'NULL', 'call to method calculateDuration '); $t->todo("call to method calculateDuration using {$sInitDate}, {$sEndDate}, {$UsrUid}, {$ProUid}, {$TasUid} "); //checking method 'prepareInformation' $t->can_ok($obj, 'prepareInformation', 'prepareInformation() is callable'); //$result = $obj->prepareInformation ( $UsrUid, $ProUid, $TasUid); //$t->isa_ok( $result, 'NULL', 'call to method prepareInformation '); $t->todo("call to method prepareInformation using {$UsrUid}, {$ProUid}, {$TasUid} "); //checking method 'setSkipEveryYear' $t->can_ok($obj, 'setSkipEveryYear', 'setSkipEveryYear() is callable');
foreach ($reflect->getMethods() as $reflectmethod) { $params = ''; foreach ($reflectmethod->getParameters() as $key => $row) { if ($params != '') { $params .= ', '; } $params .= '$' . $row->name; } $testItems++; $methods[$reflectmethod->getName()] = $params; } $t->diag('$className'); $t->isa_ok($obj, 'Installer', 'class $className created'); $t->is(count($methods), 16, "class {$className} have " . 16 . ' methods.'); //checking method '__construct' $t->can_ok($obj, '__construct', '__construct() is callable'); //$result = $obj->__construct ( ); //$t->isa_ok( $result, 'NULL', 'call to method __construct '); $t->todo("call to method __construct using "); //checking method 'create_site' $t->can_ok($obj, 'create_site', 'create_site() is callable'); //$result = $obj->create_site ( $config, $confirmed); //$t->isa_ok( $result, 'NULL', 'call to method create_site '); $t->todo("call to method create_site using {$config}, {$confirmed} "); //checking method 'isset_site' $t->can_ok($obj, 'isset_site', 'isset_site() is callable'); //$result = $obj->isset_site ( $name); //$t->isa_ok( $result, 'NULL', 'call to method isset_site '); $t->todo("call to method isset_site using {$name} "); //checking method 'create_site_test' $t->can_ok($obj, 'create_site_test', 'create_site_test() is callable');
} else { exit(201); } require_once PATH_GULLIVER . 'class.dbconnection.php'; $obj = new DBConnection(); $method = array(); $methods = get_class_methods('DBConnection'); $t = new lime_test(20, new lime_output_color()); $t->diag('class DBConnection'); /* Listing Method */ $t->is(count($methods), 8, "class DBConnection " . 8 . " methods."); $t->todo('Listing Method'); $t->is($methods[0], 'DBConnection', $counter++ . ' DBConnection'); $t->is($methods[1], 'Reset', $counter++ . ' Reset'); $t->is($methods[2], 'Free', $counter++ . ' Free'); $t->is($methods[3], 'Close', $counter++ . ' Close'); $t->is($methods[4], 'logError', $counter++ . ' logError'); $t->is($methods[5], 'traceError', $counter++ . ' traceError'); $t->is($methods[6], 'printArgs', $counter++ . ' printArgs'); $t->is($methods[7], 'GetLastID', $counter++ . ' GetLastID'); /* checking methods */ $t->todo('checking methods'); $t->can_ok($obj, 'DBConnection', 'DBConnection()'); $t->can_ok($obj, 'Reset', 'Reset()'); $t->can_ok($obj, 'Free', 'Free()'); $t->can_ok($obj, 'Close', 'Close()'); $t->can_ok($obj, 'logError', 'logError()'); $t->can_ok($obj, 'traceError', 'traceError()'); $t->can_ok($obj, 'printArgs', 'printArgs()'); $t->can_ok($obj, 'GetLastID', 'GetLastID()'); $t->todo('Review, specific examples.');
} else { exit(201); } require_once PATH_GULLIVER . 'class.dbconnection.php'; require_once PATH_GULLIVER . 'class.error.php'; $obj = new G_Error(); $method = array(); $testItems = 0; $class_methods = get_class_methods('G_Error'); foreach ($class_methods as $method_name) { $methods[$testItems] = $method_name; $testItems++; } $t = new lime_test(11, new lime_output_color()); $t->diag('class error'); // $t->is($testItems, 13, "class G_Error " . 13 . " methods."); $t->isa_ok($obj, 'G_Error', 'class G_Error created'); $t->is(G_ERROR, -100, 'G_ERROR constant defined'); $t->is(G_ERROR_ALREADY_ASSIGNED, -118, 'G_ERROR_ALREADY_ASSIGNED defined'); $obj = new G_Error("string"); $t->is($obj->code, -1, 'default code error'); $t->is($obj->message, "G Error: string", 'default message error'); $t->is($obj->level, E_USER_NOTICE, 'default level error'); $obj = new G_Error(G_ERROR_SYSTEM_UID); $t->is($obj->code, -105, 'code error'); $t->is($obj->message, "G Error: ", 'message error'); $t->can_ok($obj, "errorMessage", "exists method errorMessage"); $msg = $obj->errorMessage(G_ERROR); //$t->is( $msg->code, -100, 'fail in method errorMessage'); $t->todo('fail in method errorMessage');
foreach ($reflect->getMethods() as $reflectmethod) { $params = ''; foreach ($reflectmethod->getParameters() as $key => $row) { if ($params != '') { $params .= ', '; } $params .= '$' . $row->name; } $testItems++; $methods[$reflectmethod->getName()] = $params; } $t->diag("class {$className} "); $t->isa_ok($obj, $className, "class {$className} created"); $t->is(count($methods), 12, "class {$className} have " . 12 . ' methods.'); //checking method 'archive' $t->can_ok($obj, 'archive', 'archive() is callable'); //$result = $obj->archive ( $name); //$t->isa_ok( $result, 'NULL', 'call to method archive '); $t->todo("call to method archive using {$name} "); //checking method 'set_options' $t->can_ok($obj, 'set_options', 'set_options() is callable'); //$result = $obj->set_options ( $options); //$t->isa_ok( $result, 'NULL', 'call to method set_options '); $t->todo("call to method set_options using {$options} "); //checking method 'create_archive' $t->can_ok($obj, 'create_archive', 'create_archive() is callable'); //$result = $obj->create_archive ( ); //$t->isa_ok( $result, 'NULL', 'call to method create_archive '); $t->todo("call to method create_archive using "); //checking method 'add_data' $t->can_ok($obj, 'add_data', 'add_data() is callable');
$reflect = new ReflectionClass($className); $method = array(); $testItems = 0; foreach ($reflect->getMethods() as $reflectmethod) { $params = ''; foreach ($reflectmethod->getParameters() as $key => $row) { if ($params != '') { $params .= ', '; } $params .= '$' . $row->name; } $testItems++; $methods[$reflectmethod->getName()] = $params; } //To change the case only the first letter of each word, TIA $className = ucwords($className); $t->diag("class {$className}"); $t->isa_ok($obj, $className, "class {$className} created"); //$t->is( count($methods) , 2, "class $className have " . 2 . ' methods.' ); $t->is(count($methods), 7, "class {$className} have " . 7 . ' methods.'); //checking method 'getSessionUser' $t->can_ok($obj, 'getSessionUser', 'getSessionUser() is callable'); //$result = $obj->getSessionUser ( $sSessionId); //$t->isa_ok( $result, 'NULL', 'call to method getSessionUser '); $t->todo("call to method getSessionUser using {$sSessionId} "); //checking method 'verifySession' $t->can_ok($obj, 'verifySession', 'verifySession() is callable'); //$result = $obj->verifySession ( $sSessionId); //$t->isa_ok( $result, 'NULL', 'call to method verifySession '); $t->todo("call to method verifySession using {$sSessionId} "); $t->todo('review all pendings methods in this class');
$testItems = 0; foreach ($reflect->getMethods() as $reflectmethod) { $params = ''; foreach ($reflectmethod->getParameters() as $key => $row) { if ($params != '') { $params .= ', '; } $params .= '$' . $row->name; } $testItems++; $methods[$reflectmethod->getName()] = $params; } $t->diag('class $className'); $t->isa_ok($obj, 'JavaBridgePM', 'class $className created'); $t->is(count($methods), 3, "class {$className} have " . 3 . ' methods.'); //checking method 'checkJavaExtension' $t->can_ok($obj, 'checkJavaExtension', 'checkJavaExtension() is callable'); //$result = $obj->checkJavaExtension ( ); //$t->isa_ok( $result, 'NULL', 'call to method checkJavaExtension '); $t->todo("call to method checkJavaExtension using "); //checking method 'convertValue' $t->can_ok($obj, 'convertValue', 'convertValue() is callable'); //$result = $obj->convertValue ( $value, $className); //$t->isa_ok( $result, 'NULL', 'call to method convertValue '); $t->todo("call to method convertValue using {$value}, {$className} "); //checking method 'generateJrxmlFromDynaform' $t->can_ok($obj, 'generateJrxmlFromDynaform', 'generateJrxmlFromDynaform() is callable'); //$result = $obj->generateJrxmlFromDynaform ( $outDocUid, $dynaformUid, $template); //$t->isa_ok( $result, 'NULL', 'call to method generateJrxmlFromDynaform '); $t->todo("call to method generateJrxmlFromDynaform using {$outDocUid}, {$dynaformUid}, {$template} "); $t->todo('review all pendings methods in this class');
require_once PATH_THIRDPARTY . '/lime/lime.php'; require_once PATH_THIRDPARTY . 'lime/yaml.class.php'; G::LoadThirdParty('smarty/libs', 'Smarty.class'); G::LoadSystem('xmlform'); G::LoadSystem('xmlDocument'); G::LoadSystem('form'); require_once 'propel/Propel.php'; require_once "creole/Creole.php"; require_once PATH_CORE . "config/databases.php"; $counter = 1; $obj = new Form('login/login'); $method = array(); $testItems = 0; $methods = get_class_methods('Form'); $t = new lime_test(15, new lime_output_color()); $t->diag('class Form'); $t->is(count($methods), 12, "class Form " . count($methods) . " methods."); $t->can_ok($obj, 'Form', $counter++ . ' Form()'); $t->can_ok($obj, 'setDefaultValues', $counter++ . ' setDefaultValues()'); $t->can_ok($obj, 'printTemplate', $counter++ . ' printTemplate()'); $t->can_ok($obj, 'render', $counter++ . ' render()'); $t->can_ok($obj, 'setValues', $counter++ . ' setValues()'); $t->can_ok($obj, 'getFields', $counter++ . ' getFields()'); $t->can_ok($obj, 'validatePost', $counter++ . ' validatePost()'); $t->can_ok($obj, 'validateArray', $counter++ . ' validateArray()'); $t->can_ok($obj, 'getVars', $counter++ . ' getVars()'); $t->can_ok($obj, 'validateRequiredFields', $counter++ . ' validateRequiredFields()'); $t->can_ok($obj, 'parseFile', $counter++ . ' parseFile()'); $t->can_ok($obj, 'cloneObject', $counter++ . ' cloneObject()'); $t->is(count($methods), --$counter, "ok"); $t->todo('review all pendings in this class');
foreach ($reflect->getMethods() as $reflectmethod) { $params = ''; foreach ($reflectmethod->getParameters() as $key => $row) { if ($params != '') { $params .= ', '; } $params .= '$' . $row->name; } $testItems++; $methods[$reflectmethod->getName()] = $params; } $t->diag('class $className'); $t->isa_ok($obj, $className, 'class $className created'); $t->is(count($methods), 8, "class {$className} have " . 8 . ' methods.'); //checking method '__construct' $t->can_ok($obj, '__construct', '__construct() is callable'); //$result = $obj->__construct ( $fileData); //$t->isa_ok( $result, 'NULL', 'call to method __construct '); $t->todo("call to method __construct using {$fileData} "); //checking method 'returnHeader' $t->can_ok($obj, 'returnHeader', 'returnHeader() is callable'); //$result = $obj->returnHeader ( ); //$t->isa_ok( $result, 'NULL', 'call to method returnHeader '); $t->todo("call to method returnHeader using "); //checking method 'returnBody' $t->can_ok($obj, 'returnBody', 'returnBody() is callable'); //$result = $obj->returnBody ( ); //$t->isa_ok( $result, 'NULL', 'call to method returnBody '); $t->todo("call to method returnBody using "); //checking method 'returnErrors' $t->can_ok($obj, 'returnErrors', 'returnErrors() is callable');
<?php include dirname(__FILE__) . '/../bootstrap/unit.php'; $t = new lime_test(79, new lime_output_color()); $t->info('FuzzyDateTime instanciation'); $t->isa_ok(new FuzzyDateTime(), 'FuzzyDateTime', 'New creates an object of the right class'); $t->can_ok(new FuzzyDateTime(), 'getDateTimeStringFromArray', 'Object FuzzyDateTime has a method named: getDateTimeStringFromArray'); $t->can_ok(new FuzzyDateTime(), 'checkDateArray', 'Object FuzzyDateTime has a method named: checkDateArray'); $t->can_ok(new FuzzyDateTime(), 'setMask', 'Object FuzzyDateTime has a method named: setMask'); $t->can_ok(new FuzzyDateTime(), 'setStart', 'Object FuzzyDateTime has a method named: setStart'); $t->can_ok(new FuzzyDateTime(), 'setWithTime', 'Object FuzzyDateTime has a method named: setWithTime'); $t->can_ok(new FuzzyDateTime(), 'setdateFormat', 'Object FuzzyDateTime has a method named: setDateFormat'); $t->can_ok(new FuzzyDateTime(), 'setTimeFormat', 'Object FuzzyDateTime has a method named: setTimeFormat'); $t->can_ok(new FuzzyDateTime(), 'getMask', 'Object FuzzyDateTime has a method named: getMask'); $t->can_ok(new FuzzyDateTime(), 'getStart', 'Object FuzzyDateTime has a method named: getStart'); $t->can_ok(new FuzzyDateTime(), 'getWithTime', 'Object FuzzyDateTime has a method named: getWithTime'); $t->can_ok(new FuzzyDateTime(), 'getDateFormat', 'Object FuzzyDateTime has a method named: getDateFormat'); $t->can_ok(new FuzzyDateTime(), 'getTimeFormat', 'Object FuzzyDateTime has a method named: getTimeFormat'); $t->can_ok(new FuzzyDateTime(), 'setMaskFromDate', 'Object FuzzyDateTime has a method named: setMaskFromDate'); $t->can_ok(new FuzzyDateTime(), 'getMaskFromDate', 'Object FuzzyDateTime has a method named: getMaskFromDate'); $t->can_ok(new FuzzyDateTime(), 'getMaskFor', 'Object FuzzyDateTime has a method named: getMaskFor'); $t->can_ok(new FuzzyDateTime(), 'getDateTime', 'Object FuzzyDateTime has a method named: getDateTime'); $t->can_ok(new FuzzyDateTime(), 'getDateTimeAsArray', 'Object FuzzyDateTime has a method named: getDateTimeAsArray'); $t->can_ok(new FuzzyDateTime(), 'getDateMasked', 'Object FuzzyDateTime has a method named: getDateMasked'); $t->can_ok(new FuzzyDateTime(), '__ToString', 'Object FuzzyDateTime has a method named: __ToString'); $fdt = new FuzzyDateTime(); $currentDate = $fdt->format('d/m/Y'); $currentDateTime = $fdt->format('d/m/Y H:i:s'); $t->is($fdt->getDateTime(), $currentDate, 'Get the date coming with the FuzzyDateTime object instanciation'); $t->is($fdt->getDateTime(true), $currentDateTime, 'Get the date and time coming with the FuzzyDateTime object instanciation: ok'); $fdt->setStart(false);
foreach ($reflect->getMethods() as $reflectmethod) { $params = ''; foreach ($reflectmethod->getParameters() as $key => $row) { if ($params != '') { $params .= ', '; } $params .= '$' . $row->name; } $testItems++; $methods[$reflectmethod->getName()] = $params; } $t->diag('class $className'); $t->isa_ok($obj, 'Report', 'class $className created'); $t->is(count($methods), 14, "class {$className} have " . 14 . ' methods.'); //checking method 'generatedReport1' $t->can_ok($obj, 'generatedReport1', 'generatedReport1() is callable'); //$result = $obj->generatedReport1 ( ); //$t->isa_ok( $result, 'NULL', 'call to method generatedReport1 '); $t->todo("call to method generatedReport1 using "); //checking method 'generatedReport1_filter' $t->can_ok($obj, 'generatedReport1_filter', 'generatedReport1_filter() is callable'); //$result = $obj->generatedReport1_filter ( $from, $to, $startedby); //$t->isa_ok( $result, 'NULL', 'call to method generatedReport1_filter '); $t->todo("call to method generatedReport1_filter using {$from}, {$to}, {$startedby} "); //checking method 'descriptionReport1' $t->can_ok($obj, 'descriptionReport1', 'descriptionReport1() is callable'); //$result = $obj->descriptionReport1 ( $PRO_UID); //$t->isa_ok( $result, 'NULL', 'call to method descriptionReport1 '); $t->todo("call to method descriptionReport1 using {$PRO_UID} "); //checking method 'generatedReport2' $t->can_ok($obj, 'generatedReport2', 'generatedReport2() is callable');
foreach ($reflectmethod->getParameters() as $key => $row) { if ($params != '') { $params .= ', '; } $params .= '$' . $row->name; } $testItems++; $methods[$reflectmethod->getName()] = $params; } //To change the case only the first letter of each word, TIA $className = ucwords($className); $t->diag("class {$className}"); $t->isa_ok($obj, $className, "class {$className} created"); $t->is(count($methods), 14, "class {$className} have " . 14 . ' methods.'); //checking method 'getFieldnames' $t->can_ok($obj, 'getFieldnames', 'getFieldnames() is callable'); //$result = $obj->getFieldnames ( $classname, $type); //$t->isa_ok( $result, 'NULL', 'call to method getFieldnames '); $t->todo("call to method getFieldnames using {$classname}, {$type} "); //checking method 'translateFieldname' $t->can_ok($obj, 'translateFieldname', 'translateFieldname() is callable'); //$result = $obj->translateFieldname ( $classname, $fieldname, $fromType, $toType); //$t->isa_ok( $result, 'NULL', 'call to method translateFieldname '); $t->todo("call to method translateFieldname using {$classname}, {$fieldname}, {$fromType}, {$toType} "); //checking method 'doDelete' $t->can_ok($obj, 'doDelete', 'doDelete() is callable'); //$result = $obj->doDelete ( $criteria, $con); //$t->isa_ok( $result, 'NULL', 'call to method doDelete '); $t->todo("call to method doDelete using {$criteria}, {$con} "); //checking method 'doDeleteAll' $t->can_ok($obj, 'doDeleteAll', 'doDeleteAll() is callable');
foreach ($reflect->getMethods() as $reflectmethod) { $params = ''; foreach ($reflectmethod->getParameters() as $key => $row) { if ($params != '') { $params .= ', '; } $params .= '$' . $row->name; } $testItems++; $methods[$reflectmethod->getName()] = $params; } $t->diag('class $className'); $t->isa_ok($obj, $className, 'class $className created'); $t->is(count($methods), 13, "class {$className} have " . 13 . ' methods.'); //checking method '__construct' $t->can_ok($obj, '__construct', '__construct() is callable'); //$result = $obj->__construct ( ); //$t->isa_ok( $result, 'NULL', 'call to method __construct '); $t->todo("call to method __construct using "); //checking method 'setServer' $t->can_ok($obj, 'setServer', 'setServer() is callable'); //$result = $obj->setServer ( $sServer); //$t->isa_ok( $result, 'NULL', 'call to method setServer '); $t->todo("call to method setServer using {$sServer} "); //checking method 'setPort' $t->can_ok($obj, 'setPort', 'setPort() is callable'); //$result = $obj->setPort ( $iPort); //$t->isa_ok( $result, 'NULL', 'call to method setPort '); $t->todo("call to method setPort using {$iPort} "); //checking method 'setReturnPath' $t->can_ok($obj, 'setReturnPath', 'setReturnPath() is callable');
if (isset($G_ENVIRONMENTS)) { $dbfile = $G_ENVIRONMENTS[G_TEST_ENV]['dbfile']; if (!file_exists($dbfile)) { printf("%s \n", pakeColor::colorize("dbfile {$dbfile} doesn't exist for environment " . G_ENVIRONMENT, 'ERROR')); exit(200); } else { include $dbfile; } } else { exit(201); } G::LoadThirdParty('pear/json', 'class.json'); G::LoadThirdParty('smarty/libs', 'Smarty.class'); G::LoadSystem('xmlform'); G::LoadSystem('xmlDocument'); G::LoadSystem('form'); G::LoadSystem('xmlMenu'); $t = new lime_test(4, new lime_output_color()); $obj = new xmlMenu('login/login'); $method = array(); $testItems = 0; $class_methods = get_class_methods('xmlMenu'); foreach ($class_methods as $method_name) { $methods[$testItems] = $method_name; $testItems++; } $t->diag('class xmlMenu'); $t->is($testItems, 12, "class xmlMenu " . $testItems . " methods."); $t->isa_ok($obj, 'xmlMenu', 'class xmlMenu created'); $t->can_ok($obj, 'render', 'render()'); $t->todo('review all pendings in this class');