cain Thu Jul 3 07:50:16 2003 EDT
Modified files:
/pear/Tree/tests UnitTest.php index.php
Log:
- properly inplemented test stup
Index: pear/Tree/tests/UnitTest.php
diff -u pear/Tree/tests/UnitTest.php:1.1 pear/Tree/tests/UnitTest.php:1.2
--- pear/Tree/tests/UnitTest.php:1.1 Fri Jun 20 12:54:51 2003
+++ pear/Tree/tests/UnitTest.php Thu Jul 3 07:50:15 2003
@@no-spam -1,14 +1,24 @@no-spam
<?php
//
-// $Id: UnitTest.php,v 1.1 2003/06/20 16:54:51 cain Exp $
+// $Id: UnitTest.php,v 1.2 2003/07/03 11:50:15 cain Exp $
//
+require_once 'DB.php';
require_once 'PHPUnit.php';
class UnitTest extends PhpUnit_TestCase
{
function setUp()
{
+ // common setup, setup the table structure and data in the db
+ // (this actually also does the tearDown, since we have the DROP TABLE queries in the setup too
+ require 'sql.php';
+ $db = DB::connect(DB_DSN);
+ foreach ($dbStructure[$db->phptype]['setup'] as $aQuery) {
+ if (DB::isError($ret=$db->query($aQuery))) {
+ die($ret->getUserInfo());
+ }
+ }
$this->setLooselyTyped(true);
}
Index: pear/Tree/tests/index.php
diff -u pear/Tree/tests/index.php:1.1 pear/Tree/tests/index.php:1.2
--- pear/Tree/tests/index.php:1.1 Fri Jun 20 12:54:51 2003
+++ pear/Tree/tests/index.php Thu Jul 3 07:50:15 2003
@@no-spam -1,6 +1,6 @@no-spam
<?php
//
-// $Id: index.php,v 1.1 2003/06/20 16:54:51 cain Exp $
+// $Id: index.php,v 1.2 2003/07/03 11:50:15 cain Exp $
//
@@no-spam -11,19 +11,7 @@no-spam
define(DB_DSN,'mysql://root@no-spam
define(TABLE_TREENESTED, 'TreeNested');
-require_once 'sql.php';
require_once 'Tree/Tree.php';
-
-//
-// common setup (this actually also does the tearDown, since we have the DROP TABLE queries in the setup too
-//
-require_once 'DB.php';
-$db = DB::connect(DB_DSN);
-foreach ($dbStructure[$db->phptype]['setup'] as $aQuery) {
- if (DB::isError($ret=$db->query($aQuery))) {
- die($ret->getUserInfo());
- }
-}
//
// run the test suite