Test more objectManager functions

This commit is contained in:
Alexander Nicolaysen Sørnes
2007-03-13 21:05:11 +00:00
committed by WineHQ
parent 9becc84b36
commit fc47fdabcd

View File

@@ -12,15 +12,19 @@ require_once(BASE.'include/maintainer.php');
//require_once(BASE.'include/version_queue.php'); //require_once(BASE.'include/version_queue.php');
/* internal function */ /* internal function */
function test_class($sClassName) function test_class($sClassName, $aTestMethods)
{ {
$oOMM = new objectManager($sClassName); $oObject = new ObjectManager("");
if(!$oOMM->hasValidMethods(true)) $oObject->sClass = $sClassName;
if(!$oObject->checkMethods($aTestMethods, false))
{ {
echo $oObject->sClass." class does not have valid methods for use with".
" the object manager\n";
return false; return false;
} else
{
echo "PASSED:\t\t".$oObject->sClass."\n";
} }
return true;
} }
function test_object_methods() function test_object_methods()
@@ -65,44 +69,18 @@ function test_object_methods()
} else } else
{ {
echo "PASSED:\t\t".$sClassName."\n"; echo "PASSED:\t\t".$sClassName."\n";
} }*/
$sClassName = 'maintainer';
if(!test_class($sClassName))
{
echo $sClassName." class does not have valid methods for use with the object manager\n";
return false;
} else
{
echo "PASSED:\t\t".$sClassName."\n";
} */
$aTestMethods = array("objectOutputHeader", "objectOutputTableRow", $aTestMethods = array("objectOutputHeader", "objectOutputTableRow",
"objectGetEntries", "display", "objectGetEntries", "display",
"objectGetInstanceFromRow", "outputEditor", "canEdit"); "objectGetInstanceFromRow", "outputEditor", "canEdit",
"getOutputEditorValues", "objectGetEntries",
"objectMakeUrl", "objectMakeLink");
$oObject = new ObjectManager(""); test_class("distribution", $aTestMethods);
$oObject->sClass = 'distribution'; test_class("vendor", $aTestMethods);
if(!$oObject->checkMethods($aTestMethods, false)) /* test_class("maintainer", $aTestMethods);
{ test_class("screenshot", $aTestMethods); */
echo $oObject->sClass." class does not have valid methods for use with".
" the object manager\n";
return false;
} else
{
echo "PASSED:\t\t".$oObject->sClass."\n";
}
$oObject->sClass = 'vendor';
if(!$oObject->checkMethods($aTestMethods, false))
{
echo $oObject->sClass." class does not have valid methods for use with".
" the object manager\n";
return false;
} else
{
echo "PASSED:\t\t".$oObject->sClass."\n";
}
return true; return true;
} }