Commit e1844bb44677d79e3d25a0f87e6c0c49da6cc17b
1 parent
2dfdd589
Remove OBE'd tests - they're not helping anyone.
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3350 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
10 changed files
with
0 additions
and
568 deletions
tests/subscriptions/subscription.php deleted
| 1 | -<?php | |
| 2 | - | |
| 3 | -require_once("../../config/dmsDefaults.php"); | |
| 4 | - | |
| 5 | -/** | |
| 6 | - * Contains unit test code for class Subscription in /lib/subscription/Subscription.inc | |
| 7 | - * | |
| 8 | - * Tests are: | |
| 9 | - * - creation of subscription object | |
| 10 | - * - setting/getting of values | |
| 11 | - * - storing of object | |
| 12 | - * - updating of object | |
| 13 | - * - deletion of object | |
| 14 | - * | |
| 15 | - * @package tests.subscriptions | |
| 16 | - */ | |
| 17 | -if (checkSession()) { | |
| 18 | - require_once("$default->fileSystemRoot/lib/subscriptions/Subscription.inc"); | |
| 19 | - | |
| 20 | - echo "<b>Testing creation of new folder subscription object</b><br>"; | |
| 21 | - $oFolderSubscription = & new Subscription(1, 1, SubscriptionConstants::subscriptionType("FolderSubscription")); | |
| 22 | - if (isset($oFolderSubscription)) { | |
| 23 | - echo "Passed folder subscription creation test<br><br>"; | |
| 24 | - | |
| 25 | - echo "<b>Testing getting and setting of values</b><br><br>"; | |
| 26 | - | |
| 27 | - echo "Current value of primary key: " . $oFolderSubscription->getID() . "<br>"; | |
| 28 | - echo "This value CANNOT be altered manually<br><br>"; | |
| 29 | - | |
| 30 | - echo "Current value of folder subscription user id: " . $oFolderSubscription->getUserID() . "<br>"; | |
| 31 | - echo "Setting folder subscription user id to: 23<br>"; | |
| 32 | - $oFolderSubscription->setUserID(23); | |
| 33 | - echo "New value of folder subscription user id: " . $oFolderSubscription->getUserID() . "<br><br>"; | |
| 34 | - | |
| 35 | - echo "Current value of folder subscription folder id: " . $oFolderSubscription->getExternalID() . "<br>"; | |
| 36 | - echo "Setting folder subscription folder id to 56<br>"; | |
| 37 | - $oFolderSubscription->getExternalID(56); | |
| 38 | - echo "New folder subscription folder id: " . $oFolderSubscription->getExternalID() . "<br><br>"; | |
| 39 | - | |
| 40 | - echo "<b>Testing storing of object in database</b><br>"; | |
| 41 | - if ($oFolderSubscription->create()) { | |
| 42 | - echo "Passed storing of object in database test<br><br>"; | |
| 43 | - | |
| 44 | - echo "<b>Testing object updating</b><br>"; | |
| 45 | - if ($oFolderSubscription->update()) { | |
| 46 | - echo "Passed object updating test<br><br>"; | |
| 47 | - | |
| 48 | - echo "<b>Testing getting of object from database using primary key</b><br>"; | |
| 49 | - $oNewFolderSubscription = & Subscription::get($oFolderSubscription->getID(), SubscriptionConstants::subscriptionType("FolderSubscription")); | |
| 50 | - if (isset($oNewFolderSubscription)) { | |
| 51 | - echo "<pre> " . arrayToString($oNewFolderSubscription) . "</pre><br>"; | |
| 52 | - echo "Passed getting of object from db using primary key<br><br>"; | |
| 53 | - | |
| 54 | - echo "<b>Testing deletion of object from database</b><br>"; | |
| 55 | - if ($oFolderSubscription->delete()) { | |
| 56 | - echo "Passed deletion of object from database test.<br><br>END OF UNIT TEST"; | |
| 57 | - } else { | |
| 58 | - echo "Failed deletion of object from database test(" . $_SESSION["errorMessage"] . ")"; | |
| 59 | - } | |
| 60 | - } else { | |
| 61 | - echo "Failed getting of object test(" . $_SESSION["errorMessage"] . ").<br> Tests not run (a)deletion of object<br>"; | |
| 62 | - } | |
| 63 | - } else { | |
| 64 | - echo "Failed object updating test(" . $_SESSION["errorMessage"] . ").<br> Tests not run (a)deletion of object (b)getting of object using id<br>"; | |
| 65 | - } | |
| 66 | - } else { | |
| 67 | - echo "Failed storing of object in database test (" . $_SESSION["errorMessage"] . ").<br> Tests not run (a)updating of object (b)deletion of object (c)getting of object using id<br>"; | |
| 68 | - } | |
| 69 | - } else { | |
| 70 | - echo "Failed folder subscription creation tests(" . $_SESSION["errorMessage"] . ").<br>Tests not run: (a)setting/getting of values (b)storing of object (c)updating of object (d)deletion of object (e)getting of object using id<br>"; | |
| 71 | - } | |
| 72 | - | |
| 73 | - echo "<br><br>"; | |
| 74 | - | |
| 75 | - echo "<b>Testing creation of new document subscription object</b><br>"; | |
| 76 | - $oDocumentSubscription = & new Subscription(1, 1, SubscriptionConstants::subscriptionType("DocumentSubscription")); | |
| 77 | - | |
| 78 | - if (isset($oDocumentSubscription)) { | |
| 79 | - echo "Passed document subscription creation test<br><br>"; | |
| 80 | - | |
| 81 | - echo "<b>Testing getting and setting of values</b><br><br>"; | |
| 82 | - | |
| 83 | - echo "Current value of primary key: " . $oDocumentSubscription->getID() . "<br>"; | |
| 84 | - echo "This value CANNOT be altered manually<br><br>"; | |
| 85 | - | |
| 86 | - echo "Current value of document subscription user id: " . $oDocumentSubscription->getUserID() . "<br>"; | |
| 87 | - echo "Setting document subscription user id to: 12<br>"; | |
| 88 | - $oDocumentSubscription->setUserID(12); | |
| 89 | - echo "New value of document subscription user id: " . $oDocumentSubscription->getUserID() . "<br><br>"; | |
| 90 | - | |
| 91 | - echo "Current value of document subscription document id: " . $oDocumentSubscription->getExternalID() . "<br>"; | |
| 92 | - echo "Setting document subscription document id to 34<br>"; | |
| 93 | - $oDocumentSubscription->getExternalID(34); | |
| 94 | - echo "New document subscription document id: " . $oDocumentSubscription->getExternalID() . "<br><br>"; | |
| 95 | - | |
| 96 | - echo "<b>Testing storing of object in database</b><br>"; | |
| 97 | - if ($oDocumentSubscription->create()) { | |
| 98 | - echo "Passed storing of object in database test<br><br>"; | |
| 99 | - | |
| 100 | - echo "<b>Testing object updating</b><br>"; | |
| 101 | - if ($oDocumentSubscription->update()) { | |
| 102 | - echo "Passed object updating test<br><br>"; | |
| 103 | - | |
| 104 | - echo "<b>Testing getting of object from database using primary key</b><br>"; | |
| 105 | - $oNewDocumentSubscription = & Subscription::get($oDocumentSubscription->getID(), SubscriptionConstants::subscriptionType("DocumentSubscription")); | |
| 106 | - if (isset($oNewDocumentSubscription)) { | |
| 107 | - echo "<pre> " . arrayToString($oNewDocumentSubscription) . "</pre><br>"; | |
| 108 | - echo "Passed getting of object from db using primary key<br><br>"; | |
| 109 | - | |
| 110 | - echo "<b>Testing deletion of object from database</b><br>"; | |
| 111 | - if ($oDocumentSubscription->delete()) { | |
| 112 | - echo "Passed deletion of object from database test.<br><br>END OF UNIT TEST"; | |
| 113 | - } else { | |
| 114 | - echo "Failed deletion of object from database test"; | |
| 115 | - } | |
| 116 | - } else { | |
| 117 | - echo "Failed getting of object test.<br> Tests not run (a)deletion of object<br>"; | |
| 118 | - } | |
| 119 | - } else { | |
| 120 | - echo "Failed object updating test.<br> Tests not run (a)deletion of object (b)getting of object using id<br>"; | |
| 121 | - } | |
| 122 | - } else { | |
| 123 | - echo "Failed storing of object in database test.<br> Tests not run (a)updating of object (b)deletion of object (c)getting of object using id<br>"; | |
| 124 | - } | |
| 125 | - } else { | |
| 126 | - echo "Failed document subscription creation tests.<br>Tests not run: (a)setting/getting of values (b)storing of object (c)updating of object (d)deletion of object (e)getting of object using id<br>"; | |
| 127 | - } | |
| 128 | -} | |
| 129 | - | |
| 130 | -?> |
tests/subscriptions/subscriptionEngine.php deleted
| 1 | -<?php | |
| 2 | -include("../../config/dmsDefaults.php"); | |
| 3 | - | |
| 4 | -if (checkSession()) { | |
| 5 | - require_once("$default->fileSystemRoot/lib/subscriptions/SubscriptionManager.inc"); | |
| 6 | - require_once("$default->fileSystemRoot/lib/subscriptions/SubscriptionEngine.inc"); | |
| 7 | - $oSubscriptionManager = new SubscriptionManager(); | |
| 8 | - | |
| 9 | - echo "<ul><li><b>create some test subscriptions for subscription firing testing</b></li>"; | |
| 10 | - | |
| 11 | - // add some subscriptions | |
| 12 | - $iFolderID = 1; | |
| 13 | - echo "<li>Creating folder subscriptions</li><ul>"; | |
| 14 | - for ($tmpUserID = 1; $tmpUserID<=5; $tmpUserID++) { | |
| 15 | - | |
| 16 | - if ($oSubscriptionManager->createSubscription($tmpUserID, $iFolderID, SubscriptionConstants::subscriptionType("FolderSubscription"))) { | |
| 17 | - echo "<li>created folder subscription folderID=$iFolderID for userID=$tmpUserID</li>"; | |
| 18 | - } else { | |
| 19 | - echo "<li>folder subscription creation failed(" . $_SESSION["errorMessage"] . "): folderID=$iFolderID for userID=$tmpUserID</li>"; | |
| 20 | - } | |
| 21 | - } | |
| 22 | - echo "</ul>"; | |
| 23 | - $iDocumentID = 5; | |
| 24 | - echo "<li>Creating document subscriptions</li><ul>"; | |
| 25 | - for ($tmpUserID = 6; $tmpUserID<=10; $tmpUserID++) { | |
| 26 | - if ($oSubscriptionManager->createSubscription($tmpUserID, $iDocumentID, SubscriptionConstants::subscriptionType("DocumentSubscription"))) { | |
| 27 | - echo "<li>created document subscription documentID=$iDocumentID for userID=$tmpUserID</li>"; | |
| 28 | - } else { | |
| 29 | - echo "<li>document subscription creation failed(" . $_SESSION["errorMessage"] . "): documentID=$iDocumentID for userID=$tmpUserID</li>"; | |
| 30 | - } | |
| 31 | - } | |
| 32 | - echo "</ul>"; | |
| 33 | - | |
| 34 | - // test subscription firing | |
| 35 | - echo "<li><b>Testing subscription firing</b></li><ul>"; | |
| 36 | - require_once("../../phpSniff/phpTimer.class.php"); | |
| 37 | - $timer = new phpTimer(); | |
| 38 | - | |
| 39 | - $iTotalCount = 0; | |
| 40 | - | |
| 41 | - $timer->start('subscriptionFiring'); | |
| 42 | - $timer->start('AddFolder'); | |
| 43 | - $count = SubscriptionEngine::fireSubscription($iFolderID, SubscriptionConstants::subscriptionAlertType("AddFolder"), | |
| 44 | - SubscriptionConstants::subscriptionType("FolderSubscription"), | |
| 45 | - array( "newFolderName" => "Fictitious Folder", | |
| 46 | - "parentFolderName" => "Medical Research Council")); | |
| 47 | - $iTotalCount += $count; | |
| 48 | - $timer->stop('AddFolder'); | |
| 49 | - $time = $timer->get_current('AddFolder'); | |
| 50 | - echo "<li>AddFolder: processed alerts=$count; time=$time; subs/s=" . ($time/$count) . "</li>"; | |
| 51 | - | |
| 52 | - $timer->start('RemoveFolder'); | |
| 53 | - $count = SubscriptionEngine::fireSubscription($iFolderID, SubscriptionConstants::subscriptionAlertType("RemoveFolder"), | |
| 54 | - SubscriptionConstants::subscriptionType("FolderSubscription"), | |
| 55 | - array( "removedFolderName" => "Fictitious Folder", | |
| 56 | - "parentFolderName" => "Medical Research Council")); | |
| 57 | - $iTotalCount += $count; | |
| 58 | - $timer->stop('RemoveFolder'); | |
| 59 | - $time = $timer->get_current('RemoveFolder'); | |
| 60 | - echo "<li>RemoveFolder: processed alerts=$count; time=$time; subs/s=" . ($time/$count) . "</li>"; | |
| 61 | - | |
| 62 | - $timer->start('AddDocument'); | |
| 63 | - $count = SubscriptionEngine::fireSubscription($iFolderID, SubscriptionConstants::subscriptionAlertType("AddDocument"), | |
| 64 | - SubscriptionConstants::subscriptionType("FolderSubscription"), | |
| 65 | - array( "newDocumentName" => "Fictitious Document", | |
| 66 | - "folderName" => "Medical Research Council")); | |
| 67 | - $timer->stop('AddDocument'); | |
| 68 | - $iTotalCount += $count; | |
| 69 | - $time = $timer->get_current('AddDocument'); | |
| 70 | - echo "<li>AddDocument: processed alerts=$count; time=$time; subs/s=" . ($time/$count) . "</li>"; | |
| 71 | - | |
| 72 | - $timer->start('RemoveDocument'); | |
| 73 | - $count = SubscriptionEngine::fireSubscription($iFolderID, SubscriptionConstants::subscriptionAlertType("RemoveDocument"), | |
| 74 | - SubscriptionConstants::subscriptionType("FolderSubscription"), | |
| 75 | - array( "removedDocumentName" => "Fictitious Document", | |
| 76 | - "folderName" => "Medical Research Council")); | |
| 77 | - $iTotalCount += $count; | |
| 78 | - $timer->stop('RemoveDocument'); | |
| 79 | - $time = $timer->get_current('RemoveDocument'); | |
| 80 | - echo "<li>RemoveDocument: processed alerts=$count; time=$time; subs/s=" . ($time/$count) . "</li>"; | |
| 81 | - | |
| 82 | - $timer->start('ModifyDocument'); | |
| 83 | - $count = SubscriptionEngine::fireSubscription($iDocumentID, SubscriptionConstants::subscriptionAlertType("ModifyDocument"), | |
| 84 | - SubscriptionConstants::subscriptionType("DocumentSubscription"), | |
| 85 | - array( "modifiedDocumentName" => "dashboardBL.html")); | |
| 86 | - $iTotalCount += $count; | |
| 87 | - $timer->stop('ModifyDocument'); | |
| 88 | - $time = $timer->get_current('ModifyDocument'); | |
| 89 | - echo "<li>ModifyDocument: processed alerts=$count; time=$time; subs/s=" . ($time/$count) . "</li>"; | |
| 90 | - $timer->stop('subscriptionFiring'); | |
| 91 | - | |
| 92 | - $time = $timer->get_current('subscriptionFiring'); | |
| 93 | - echo "</ul><li><b>All Subscriptions: processed alerts=$iTotalCount; time=$time; subs/s=" . ($time/$iTotalCount) . "</b></li></ul>"; | |
| 94 | - | |
| 95 | - /* | |
| 96 | - // cleanup silently | |
| 97 | - for ($i = 1; $i<=10; $i++) { | |
| 98 | - if ($i<=5) { | |
| 99 | - $oSubscriptionManager->removeSubscription($i, $iFolderID, SubscriptionConstants::subscriptionType("FolderSubscription")); | |
| 100 | - } else { | |
| 101 | - $oSubscriptionManager->removeSubscription($i, $iDocumentID, SubscriptionConstants::subscriptionType("DocumentSubscription")); | |
| 102 | - } | |
| 103 | -} | |
| 104 | - */ | |
| 105 | -} | |
| 106 | -?> |
tests/subscriptions/subscriptionManager.php deleted
| 1 | -<?php | |
| 2 | -include("../../config/dmsDefaults.php"); | |
| 3 | - | |
| 4 | -if (checkSession()) { | |
| 5 | - require_once("$default->fileSystemRoot/lib/subscriptions/SubscriptionManager.inc"); | |
| 6 | - $oSubscriptionManager = new SubscriptionManager(); | |
| 7 | - echo "<b>Testing folder subscriptions</b><br>"; | |
| 8 | - $iFolderID = 1; | |
| 9 | - $iUserID = 1; | |
| 10 | - echo "<ul><li>Testing folder subscription creation with folderID=$iFolderID, userID=$iUserID :"; | |
| 11 | - if ($oSubscriptionManager->createSubscription($iUserID, $iFolderID, SubscriptionConstants::subscriptionType("FolderSubscription"))) { | |
| 12 | - echo "Passed creating folder subscription</li>"; | |
| 13 | - | |
| 14 | - echo "<li>Testing folder subscription removal with folderID=$iFolderID, userID=$iUserID :"; | |
| 15 | - if ($oSubscriptionManager->removeSubscription($iUserID, $iFolderID, SubscriptionConstants::subscriptionType("FolderSubscription"))) { | |
| 16 | - echo "Passed removing folder subscription</li>"; | |
| 17 | - } else { | |
| 18 | - echo "Failed removing folder subscription(" . $_SESSION["errorMessage"] . ")</li>"; | |
| 19 | - } | |
| 20 | - } else { | |
| 21 | - echo "Failed creating folder subscription(" . $_SESSION["errorMessage"] . ")</li><li>Skipped folder subscription removal</li>"; | |
| 22 | - } | |
| 23 | - | |
| 24 | - echo "</ul><b>Testing document subscriptions</b><br>"; | |
| 25 | - $iDocumentID = 6; | |
| 26 | - $iUserID = 1; | |
| 27 | - echo "<ul><li>Testing document subscription creation with documentID=$iDocumentID, userID=$iUserID :"; | |
| 28 | - if ($oSubscriptionManager->createSubscription($iUserID, $iDocumentID, SubscriptionConstants::subscriptionType("DocumentSubscription"))) { | |
| 29 | - echo "Passed creating document subscription</li>"; | |
| 30 | - | |
| 31 | - echo "<li>Testing document subscription removal with documentID=$iDocumentID, userID=$iUserID :"; | |
| 32 | - if ($oSubscriptionManager->removeSubscription($iUserID, $iDocumentID, SubscriptionConstants::subscriptionType("DocumentSubscription"))) { | |
| 33 | - echo "Passed removing document subscription</li>"; | |
| 34 | - } else { | |
| 35 | - echo "Failed removing document subscription(" . $_SESSION["errorMessage"] . ")</li>"; | |
| 36 | - } | |
| 37 | - } else { | |
| 38 | - echo "Failed creating document subscription(" . $_SESSION["errorMessage"] . ")</li><li>Skipped document subscription removal</li></ul>"; | |
| 39 | - } | |
| 40 | - | |
| 41 | - echo "</ul><b>Testing subscription retrieval</b><br>"; | |
| 42 | - // first create some subscriptions | |
| 43 | - $iUserID = 10; | |
| 44 | - echo "<ul><li>Creating folder subscriptions<ul>"; | |
| 45 | - for ($tmpFolderID = 1; $tmpFolderID<=5; $tmpFolderID++) { | |
| 46 | - | |
| 47 | - if ($oSubscriptionManager->createSubscription($iUserID, $tmpFolderID, SubscriptionConstants::subscriptionType("FolderSubscription"))) { | |
| 48 | - echo "<li>created folder subscription folderID=$tmpFolderID for userID=$iUserID</li>"; | |
| 49 | - } else { | |
| 50 | - echo "<li>folder subscription creation failed(" . $_SESSION["errorMessage"] . "): folderID=$tmpFolderID for userID=$iUserID</li>"; | |
| 51 | - } | |
| 52 | - } | |
| 53 | - echo "</li></ul>"; | |
| 54 | - echo "<li>Creating document subscriptions<ul>"; | |
| 55 | - for ($tmpDocumentID = 5; $tmpDocumentID>0; $tmpDocumentID--) { | |
| 56 | - if ($oSubscriptionManager->createSubscription($iUserID, $tmpDocumentID, SubscriptionConstants::subscriptionType("DocumentSubscription"))) { | |
| 57 | - echo "<li>created document subscription documentID=$tmpDocumentID for userID=$iUserID</li>"; | |
| 58 | - } else { | |
| 59 | - echo "<li>document subscription creation failed(" . $_SESSION["errorMessage"] . "): documentID=$tmpDocumentID for userID=$iUserID</li>"; | |
| 60 | - } | |
| 61 | - } | |
| 62 | - echo "</li></ul>"; | |
| 63 | - | |
| 64 | - // now try to retrieve them | |
| 65 | - echo "<li>folder subscriptions for userID=$iUserID:"; | |
| 66 | - $aFolders = $oSubscriptionManager->retrieveUserSubscriptions($iUserID, SubscriptionConstants::subscriptionType("FolderSubscription")); | |
| 67 | - echo "<pre>" . arrayToString($aFolders) . "</pre></li>"; | |
| 68 | - | |
| 69 | - echo "<li>document subscriptions for userID=$iUserID:"; | |
| 70 | - $aDocuments = $oSubscriptionManager->retrieveUserSubscriptions($iUserID, SubscriptionConstants::subscriptionType("DocumentSubscription")); | |
| 71 | - echo "<pre>" . arrayToString($aDocuments) . "</pre></li>"; | |
| 72 | - | |
| 73 | - // now try retrieving both | |
| 74 | - echo "<li>all subscriptions for userID=$iUserID:"; | |
| 75 | - $oResults = $oSubscriptionManager->listSubscriptions($iUserID); | |
| 76 | - echo "<pre>" . arrayToString($oResults) . "</pre></li>"; | |
| 77 | - echo "</ul>"; | |
| 78 | - | |
| 79 | - // cleanup silently | |
| 80 | - for ($i = 1; $i<=5; $i++) { | |
| 81 | - $oSubscriptionManager->removeSubscription($iUserID, $i, SubscriptionConstants::subscriptionType("FolderSubscription")); | |
| 82 | - $oSubscriptionManager->removeSubscription($iUserID, $i, SubscriptionConstants::subscriptionType("DocumentSubscription")); | |
| 83 | - | |
| 84 | - $oSubscriptionManager->removeSubscription($i, $iFolderID,SubscriptionConstants::subscriptionType("FolderSubscription") ); | |
| 85 | - $oSubscriptionManager->removeSubscription($i, $iDocumentID, SubscriptionConstants::subscriptionType("DocumentSubscription")); | |
| 86 | - } | |
| 87 | -} | |
| 88 | -?> |
tests/units/unit.php deleted
| 1 | -<?php | |
| 2 | - | |
| 3 | -require_once("../../config/dmsDefaults.php"); | |
| 4 | - | |
| 5 | -/** | |
| 6 | -* Unit test for class Unit in /lib/units | |
| 7 | -* | |
| 8 | -* @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa | |
| 9 | -* @date 20 January 2003 | |
| 10 | -* @package tests.units | |
| 11 | -* | |
| 12 | -*/ | |
| 13 | - | |
| 14 | -if (checkSession) { | |
| 15 | - require_once("$default->fileSystemRoot/lib/unitmanagement/Unit.inc"); | |
| 16 | - | |
| 17 | - $oUnit = & new Unit("test unit20"); | |
| 18 | - echo "Create ? " . ($oUnit->create() ? "Yes" : "No") . "<br>"; | |
| 19 | - //$oUnit = & new Unit("test unit"); | |
| 20 | - //$oUnit->create(); | |
| 21 | - //$oUnit = & new Unit("test unit2"); | |
| 22 | - //$oUnit->create(); | |
| 23 | - //$oUnit = & new Unit("test unit"); | |
| 24 | - //$oUnit->create(); | |
| 25 | - //$oUnit->setName("suckaaa"); | |
| 26 | - | |
| 27 | - //echo $oUnit->iId; | |
| 28 | - // | |
| 29 | - //$oUnit->getUnitID("test unit20"); | |
| 30 | - ///$oUnit->create(); | |
| 31 | - $oUnit->setName("test unit200000"); | |
| 32 | - echo "Update ? " . ($oUnit->update() ? "Yes" : "No") . "<br>"; | |
| 33 | - | |
| 34 | - //echo "Delete ? " . ($oUnit->delete() ? "Yes" : "No") . "<br>"; | |
| 35 | - | |
| 36 | - /*$oNewUnit = Unit::get(1); | |
| 37 | - echo "Get ? <pre>" . print_r($oNewUnit) . "</pre>"; | |
| 38 | - $oNewUnit = Unit::getList(); | |
| 39 | - echo "GetList ? <pre>" . print_r($oNewUnit) . "</pre>"; | |
| 40 | - $oNewUnit = Unit::getList("WHERE id > 2"); | |
| 41 | - echo "GetList ? <pre>" . print_r($oNewUnit) . "</pre>"; | |
| 42 | - */ | |
| 43 | -} | |
| 44 | - | |
| 45 | -?> |
tests/users/user.php deleted
| 1 | -<?php | |
| 2 | - | |
| 3 | -require_once("../../config/dmsDefaults.php"); | |
| 4 | - | |
| 5 | -/** | |
| 6 | -* | |
| 7 | -* Unit tests for User class found in /lib/users/User.inc | |
| 8 | -* | |
| 9 | -* @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa | |
| 10 | -* @date 20 January 2003 | |
| 11 | -* @package tests.users | |
| 12 | -*/ | |
| 13 | - | |
| 14 | - | |
| 15 | -if (checkSession) { | |
| 16 | - require_once("$default->fileSystemRoot/lib/users/User.inc"); | |
| 17 | - | |
| 18 | - $oUser = & new User("johnny", "tester", "test password", 200, "ropb@jamwarehouse.com", "+27 82 422 3685", true, true, "!@#%^&*()", 3, 1); | |
| 19 | - echo "Create ? " . ($oUser->create() ? "Yes" : "No") . "<br>"; | |
| 20 | - $oUser = & new User("walker", "woooh", "test password", 200, "ropb@jamwarehouse.com", "+27 82 422 3685", true, true, "!@#%^&*()", 3, 1); | |
| 21 | - echo "Create ? " . ($oUser->create() ? "Yes" : "No") . "<br>"; | |
| 22 | - //$oUser = & new User("test login name", "test name", "test password", 200, "ropb@jamwarehouse.com", "+27 82 422 3685", true, true, "!@#%^&*()", 3, 1); | |
| 23 | - //$oUser->create(); | |
| 24 | - //$oUser = & new User("test login name", "test name", "test password", 200, "ropb@jamwarehouse.com", "+27 82 422 3685", true, true, "!@#%^&*()", 3, 1); | |
| 25 | - //$oUser->create(); | |
| 26 | - //$oUser = & new User("test login name", "test name", "test password", 200, "ropb@jamwarehouse.com", "+27 82 422 3685", true, true, "!@#%^&*()", 3, 1); | |
| 27 | - //$oUser->create(); | |
| 28 | - //echo "Update ? " . ($oUser->update() ? "Yes" : "No") . "<br>"; | |
| 29 | - //$oUser->getUserID("sonny"); | |
| 30 | - echo "Delete ? " . ($oUser->delete() ? "Yes" : "No") . "<br>"; | |
| 31 | - //$oNewUser = User::get(1); | |
| 32 | - //echo "Get ? <pre>" . print_r($oNewUser) . "</pre>"; | |
| 33 | - //$oNewUser = User::getList(); | |
| 34 | - //echo "GetList ? <pre>" . print_r($oNewUser) . "</pre>"; | |
| 35 | - //$oNewUser = User::getList("WHERE id > 3"); | |
| 36 | - //echo "GetList ? <pre>" . print_r($oNewUser) . "</pre>"; | |
| 37 | - | |
| 38 | -} | |
| 39 | - | |
| 40 | -?> |
tests/visualpatterns/listBoxTest.php deleted
| 1 | -<?php | |
| 2 | - | |
| 3 | -require_once("../../config/dmsDefaults.php"); | |
| 4 | -require_once("$default->fileSystemRoot/lib/visualpatterns/PatternListBox.inc"); | |
| 5 | - | |
| 6 | -/** | |
| 7 | -* Unit test code from PatternListBox class in /lib/visualpatterns/PatternListBox.inc | |
| 8 | -* | |
| 9 | -* @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa | |
| 10 | -* @date 16 January 2003 | |
| 11 | -* @package tests.visualpatterns | |
| 12 | -*/ | |
| 13 | - | |
| 14 | - | |
| 15 | -$oPatternListBox = & new PatternListBox("folders", "name", "id", "folders"); | |
| 16 | -echo "<html><head></head><body>" . $oPatternListBox->render() . "</body></html>"; | |
| 17 | - | |
| 18 | - | |
| 19 | -?> |
tests/visualpatterns/test.php deleted
| 1 | -<?php | |
| 2 | - | |
| 3 | -require_once ("./lib/visualpatterns/PatternMainPage.inc"); | |
| 4 | -require_once ("./lib/visualpatterns/PatternImage.inc"); | |
| 5 | -require_once ("./lib/visualpatterns/PatternTableLinks.inc"); | |
| 6 | -require_once ("./lib/visualpatterns/PatternTableSqlQuery.inc"); | |
| 7 | - | |
| 8 | -/** | |
| 9 | - * @package tests.visualpatterns | |
| 10 | - */ | |
| 11 | -//North west image | |
| 12 | -$img = new PatternImage("file://C:/temp/test/al.jpg"); | |
| 13 | - | |
| 14 | -//build the top menu of links | |
| 15 | -$aTopMenuLinks = array(0=>"www.google.com",1=>"www.yahoo.com",2=>"www.msn.com"); | |
| 16 | -$aTopMenuText = array(0=>"google",1=>"yahoo",2=>"msn"); | |
| 17 | -$oPatternTableLinks = new PatternTableLinks($aTopMenuLinks, $aTopMenuText, 3, 1); | |
| 18 | - | |
| 19 | -//build the central grid for paging through results | |
| 20 | -$aCentralPageColumns = array(0=>"name",1=>"parent",2=>"security"); | |
| 21 | -$aColumnTypes = array(0=>1,1=>2,2=>1); | |
| 22 | -$oTableSqlQuery = & new PatternTableSqlQuery("Folders", $aCentralPageColumns, $aColumnTypes); | |
| 23 | -($HTTP_GET_VARS["fStartIndex"]) ? $oTableSqlQuery->setStartIndex($HTTP_GET_VARS["fStartIndex"]) : $oTableSqlQuery->setStartIndex(0); | |
| 24 | -$oTableSqlQuery->setLinkType(1); | |
| 25 | - | |
| 26 | - | |
| 27 | - | |
| 28 | -//get a page | |
| 29 | -$tmp = new PatternMainPage(); | |
| 30 | - | |
| 31 | -//put the page together | |
| 32 | -$tmp->setNorthWestPayload($img); | |
| 33 | -$tmp->setNorthPayload($oPatternTableLinks); | |
| 34 | -$tmp->setCentralPayload($oTableSqlQuery); | |
| 35 | -$tmp->setFormAction("Navigate.inc"); | |
| 36 | -$tmp->render(); | |
| 37 | - | |
| 38 | -?> |
tests/web/subscription.php deleted
| 1 | -<?php | |
| 2 | - | |
| 3 | -require_once("../../config/dmsDefaults.php"); | |
| 4 | - | |
| 5 | -/** | |
| 6 | -* | |
| 7 | -* Unit tests for class Subscription found in /lib/web/Subscription.inc | |
| 8 | -* | |
| 9 | -* @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa | |
| 10 | -* @date 20 January 2003 | |
| 11 | -* @package tests.web | |
| 12 | -*/ | |
| 13 | - | |
| 14 | - | |
| 15 | -if (checkSession) { | |
| 16 | - require_once("$default->fileSystemRoot/lib/web/Subscription.inc"); | |
| 17 | - | |
| 18 | - $oSubscription = & new Subscription(1,1); | |
| 19 | - echo "Create ? " . ($oSubscription->create() ? "Yes" : "No") . "<br>"; | |
| 20 | - $oSubscription = & new Subscription(1,1); | |
| 21 | - $oSubscription->create(); | |
| 22 | - $oSubscription = & new Subscription(1,1); | |
| 23 | - $oSubscription->create(); | |
| 24 | - $oSubscription = & new Subscription(2,1); | |
| 25 | - $oSubscription->create(); | |
| 26 | - $oSubscription = & new Subscription(1,1); | |
| 27 | - $oSubscription->create(); | |
| 28 | - echo "Update ? " . ($oSubscription->update() ? "Yes" : "No") . "<br>"; | |
| 29 | - echo "Delete ? " . ($oSubscription->delete() ? "Yes" : "No") . "<br>"; | |
| 30 | - $oNewSubscription = Subscription::get(1); | |
| 31 | - echo "Get ? <pre>" . print_r($oNewSubscription) . "</pre>"; | |
| 32 | - $oNewSubscription = Subscription::getList(); | |
| 33 | - echo "GetList ? <pre>" . print_r($oNewSubscription) . "</pre>"; | |
| 34 | - $oNewSubscription = Subscription::getList("WHERE user_id = 2"); | |
| 35 | - echo "GetList ? <pre>" . print_r($oNewSubscription) . "</pre>"; | |
| 36 | - | |
| 37 | -} | |
| 38 | -?> |
tests/web/webDocument.php deleted
| 1 | -<?php | |
| 2 | - | |
| 3 | -require_once("../../config/dmsDefaults.php"); | |
| 4 | - | |
| 5 | -/** | |
| 6 | -* Unit test for class DocumentField found in /lib/documentmanagement/DocumentField.inc | |
| 7 | -* | |
| 8 | -* @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa | |
| 9 | -* @date 19 January 2003 | |
| 10 | -* @package tests.web | |
| 11 | -*/ | |
| 12 | - | |
| 13 | - | |
| 14 | -if (checkSession) { | |
| 15 | - require_once("$default->fileSystemRoot/lib/web/WebDocument.inc"); | |
| 16 | - | |
| 17 | - $oWebDocument = & new WebDocument(1, 1, 1, 1, getCurrentDateTime()); | |
| 18 | - echo "Create ? " . ($oWebDocument->create() ? "Yes" : "No") . "<br>"; | |
| 19 | - $oWebDocument = & new WebDocument(1, 1, 1, 1, getCurrentDateTime()); | |
| 20 | - $oWebDocument->create(); | |
| 21 | - echo "Update ? " . ($oWebDocument->update() ? "Yes" : "No") . "<br>"; | |
| 22 | - echo "Delete ? " . ($oWebDocument->delete() ? "Yes" : "No") . "<br>"; | |
| 23 | - $oNewDocumentField = WebDocument::get(1); | |
| 24 | - echo "Get ? <pre>" . var_dump($oNewDocumentField) . "</pre>"; | |
| 25 | -} | |
| 26 | - | |
| 27 | -?> |
tests/web/webSite.php deleted
| 1 | -<?php | |
| 2 | - | |
| 3 | -require_once("../../config/dmsDefaults.php"); | |
| 4 | - | |
| 5 | -/** | |
| 6 | -* | |
| 7 | -* Unit tests for WebSite class in /lib/web/WebSite.inc | |
| 8 | -* | |
| 9 | -* @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa | |
| 10 | -* @date 20 January 2003 | |
| 11 | -* @package tests.web | |
| 12 | -*/ | |
| 13 | - | |
| 14 | - | |
| 15 | -if (checkSession()) { | |
| 16 | - require_once("$default->fileSystemRoot/lib/web/WebSite.inc"); | |
| 17 | - | |
| 18 | - $oWebSite = & new WebSite("test web !@43&!@*& site", "http://www.google.com", 1); | |
| 19 | - echo "Create ? " . ($oWebSite->create() ? "Yes" : "No") . "<br>"; | |
| 20 | - $oWebSite = & new WebSite("test web !@43&!@*& site", "http://www.google.com", 1); | |
| 21 | - $oWebSite->create(); | |
| 22 | - $oWebSite = & new WebSite("test web !@43&!@*& site", "http://www.google.com", 1); | |
| 23 | - $oWebSite->create(); | |
| 24 | - $oWebSite = & new WebSite("test web !@43&!@*& site", "http://www.google.com", 1); | |
| 25 | - $oWebSite->create(); | |
| 26 | - $oWebSite = & new WebSite("test web !@43&!@*& site", "http://www.google.com", 1); | |
| 27 | - $oWebSite->create(); | |
| 28 | - echo "Update ? " . ($oWebSite->update() ? "Yes" : "No") . "<br>"; | |
| 29 | - echo "Delete ? " . ($oWebSite->delete() ? "Yes" : "No") . "<br>"; | |
| 30 | - $oNewWebSite = WebSite::get(1); | |
| 31 | - echo "Get ? <pre>" . print_r($oNewWebSite) . "</pre>"; | |
| 32 | - $aWebSiteList = WebSite::getList(); | |
| 33 | - echo "List ? <pre>" . print_r($aWebSiteList) . "</pre>"; | |
| 34 | - | |
| 35 | -} | |
| 36 | - | |
| 37 | -?> |