appdb/unit_test test_om_objects.php

WineHQ wineowner at wine.codeweavers.com
Tue Mar 13 16:05:11 CDT 2007


ChangeSet ID:	30968
CVSROOT:	/opt/cvs-commit
Module name:	appdb
Changes by:	wineowner at winehq.org	2007/03/13 16:05:11

Modified files:
	unit_test      : test_om_objects.php 

Log message:
	Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
	Test more objectManager functions

Patch: http://cvs.winehq.org/patch.py?id=30968

Old revision  New revision  Changes     Path
 1.1           1.2           +18 -40     appdb/unit_test/test_om_objects.php

Index: appdb/unit_test/test_om_objects.php
diff -u -p appdb/unit_test/test_om_objects.php:1.1 appdb/unit_test/test_om_objects.php:1.2
--- appdb/unit_test/test_om_objects.php:1.1	13 Mar 2007 21: 5:11 -0000
+++ appdb/unit_test/test_om_objects.php	13 Mar 2007 21: 5:11 -0000
@@ -12,15 +12,19 @@ require_once(BASE.'include/maintainer.ph
 //require_once(BASE.'include/version_queue.php');
 
 /* internal function */
-function test_class($sClassName)
+function test_class($sClassName, $aTestMethods)
 {
-    $oOMM = new objectManager($sClassName);
-    if(!$oOMM->hasValidMethods(true))
+    $oObject = new ObjectManager("");
+    $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;
+    } else
+    {
+        echo "PASSED:\t\t".$oObject->sClass."\n";
     }
-
-    return true;
 }
 
 function test_object_methods()
@@ -65,44 +69,18 @@ function test_object_methods()
     } else
     {
         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",
                           "objectGetEntries", "display",
-                          "objectGetInstanceFromRow", "outputEditor", "canEdit");
-
-    $oObject = new ObjectManager("");
-    $oObject->sClass = 'distribution';
-    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";
-    }
-
-    $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";
-    }
+                          "objectGetInstanceFromRow", "outputEditor", "canEdit",
+                          "getOutputEditorValues", "objectGetEntries",
+                          "objectMakeUrl", "objectMakeLink");
+
+    test_class("distribution", $aTestMethods);
+    test_class("vendor", $aTestMethods);
+/*    test_class("maintainer", $aTestMethods);
+    test_class("screenshot", $aTestMethods); */
 
     return true;
 }



More information about the wine-cvs mailing list