summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorwei <>2007-02-27 23:59:53 +0000
committerwei <>2007-02-27 23:59:53 +0000
commit56df1d34bd381e864f613cc3b72fb886dc548008 (patch)
treee4e707081bc2ad1e75402447d978e689fa66b285 /tests
parent5e62551cd31137fc507e4061090a06003843a6c7 (diff)
Fix test cases for active record.
Diffstat (limited to 'tests')
-rw-r--r--tests/simple_unit/ActiveRecord/SqliteTestCase.php5
-rw-r--r--tests/simple_unit/unit.php2
-rw-r--r--tests/test_tools/unit_tests.php13
3 files changed, 6 insertions, 14 deletions
diff --git a/tests/simple_unit/ActiveRecord/SqliteTestCase.php b/tests/simple_unit/ActiveRecord/SqliteTestCase.php
index 01026c91..94af6200 100644
--- a/tests/simple_unit/ActiveRecord/SqliteTestCase.php
+++ b/tests/simple_unit/ActiveRecord/SqliteTestCase.php
@@ -1,5 +1,4 @@
-<?php
-
+<?php
Prado::using('System.Data.ActiveRecord.TActiveRecord');
require_once(dirname(__FILE__).'/records/SqliteUsers.php');
@@ -7,7 +6,7 @@ class SqliteTestCase extends UnitTestCase
{
function setup()
{
- $conn = new TDbConnection('sqlite2:c:/Wei/workspace/ar2/tests/unit/ar_test.db');
+ $conn = new TDbConnection('sqlite2:'.dirname(__FILE__).'/ar_test.db');
TActiveRecordManager::getInstance()->setDbConnection($conn);
}
diff --git a/tests/simple_unit/unit.php b/tests/simple_unit/unit.php
index 02e645b0..b58c98c5 100644
--- a/tests/simple_unit/unit.php
+++ b/tests/simple_unit/unit.php
@@ -4,7 +4,7 @@ include_once '../test_tools/unit_tests.php';
$test_cases = dirname(__FILE__)."/";
-$tester = new PradoUnitTester($test_cases, null);
+$tester = new PradoUnitTester($test_cases);
$tester->run(new HtmlReporter());
?> \ No newline at end of file
diff --git a/tests/test_tools/unit_tests.php b/tests/test_tools/unit_tests.php
index e62c2996..61daf26c 100644
--- a/tests/test_tools/unit_tests.php
+++ b/tests/test_tools/unit_tests.php
@@ -12,14 +12,6 @@ require_once($TEST_TOOLS.'/simpletest/reporter.php');
require_once(PRADO_FRAMEWORK.'/prado.php');
-class TMockApplication extends TApplication
-{
- public function run()
- {
- $this->initApplication();
- }
-}
-
class TestFolder
{
public $name='';
@@ -66,11 +58,12 @@ class PradoUnitTester
{
private $_root;
- function __construct($root, $app_dir)
+ function __construct($root, $app_dir='.')
{
$this->_root = $root;
Prado::setPathOfAlias('Tests', $root);
- $app = new TMockApplication($app_dir);
+ if($app_dir===null) $app_dir='.';
+ $app = new TShellApplication($app_dir);
$app->run();
}