Commit c4a4eef59b608aedfe9976029b2a5a1446d30536

Authored by rob
1 parent 15bdb546

Initial revision. Unit test for Unit class in /lib/units/Unit.inc


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@415 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 37 additions and 0 deletions
tests/units/unit.php 0 → 100644
  1 +<?php
  2 +/**
  3 +* Unit test for class Unit in /lib/units
  4 +*
  5 +* @author Rob Cherry, Jam Warehouse (Pty) Ltd, South Africa
  6 +* @date 20 January 2003
  7 +* @package tests.units
  8 +*
  9 +*/
  10 +
  11 +require_once("../../config/dmsDefaults.php");
  12 +
  13 +if (checkSession) {
  14 + require_once("$default->owl_fs_root/lib/units/Unit.inc");
  15 +
  16 + $oUnit = & new Unit("test unit", 1, 2);
  17 + echo "Create ? " . ($oUnit->create() ? "Yes" : "No") . "<br>";
  18 + $oUnit = & new Unit("test unit", 1, 2);
  19 + $oUnit->create();
  20 + $oUnit = & new Unit("test unit", 1, 2);
  21 + $oUnit->create();
  22 + $oUnit = & new Unit("test unit", 1, 2);
  23 + $oUnit->create();
  24 + $oUnit = & new Unit("test unit", 1, 2);
  25 + $oUnit->create();
  26 + echo "Update ? " . ($oUnit->update() ? "Yes" : "No") . "<br>";
  27 + echo "Delete ? " . ($oUnit->delete() ? "Yes" : "No") . "<br>";
  28 + $oNewUnit = Unit::get(1);
  29 + echo "Get ? <pre>" . print_r($oNewUnit) . "</pre>";
  30 + $oNewUnit = Unit::getList();
  31 + echo "GetList ? <pre>" . print_r($oNewUnit) . "</pre>";
  32 + $oNewUnit = Unit::getList("WHERE id > 2");
  33 + echo "GetList ? <pre>" . print_r($oNewUnit) . "</pre>";
  34 +
  35 +}
  36 +
  37 +?>
... ...