summaryrefslogtreecommitdiff
path: root/tests/UnitTests
diff options
context:
space:
mode:
Diffstat (limited to 'tests/UnitTests')
-rw-r--r--tests/UnitTests/framework/Web/UI/utControl.php6
-rw-r--r--tests/UnitTests/framework/common.php6
-rw-r--r--tests/UnitTests/framework/index.php14
3 files changed, 12 insertions, 14 deletions
diff --git a/tests/UnitTests/framework/Web/UI/utControl.php b/tests/UnitTests/framework/Web/UI/utControl.php
index 8498f7c0..b96ef644 100644
--- a/tests/UnitTests/framework/Web/UI/utControl.php
+++ b/tests/UnitTests/framework/Web/UI/utControl.php
@@ -1,11 +1,7 @@
<?php
-require_once(dirname(__FILE__).'/common.php');
require_once(PRADO_DIR.'/Collections/TList.php');
require_once(PRADO_DIR.'/Collections/TMap.php');
-require_once(PRADO_DIR.'/Exceptions/TInvalidOperationException.php');
-require_once(PRADO_DIR.'/Exceptions/TInvalidDataValueException.php');
-require_once(PRADO_DIR.'/Exceptions/TInvalidExpressionException.php');
require_once(PRADO_DIR.'/Web/UI/TControl.php');
class TContext extends TComponent
@@ -102,7 +98,7 @@ class WebControl extends TControl
}
}
-class testControl extends UnitTestCase
+class utControl extends UnitTestCase
{
private $context;
private $button1;
diff --git a/tests/UnitTests/framework/common.php b/tests/UnitTests/framework/common.php
index 9f52ce41..9b7b1b37 100644
--- a/tests/UnitTests/framework/common.php
+++ b/tests/UnitTests/framework/common.php
@@ -50,13 +50,14 @@ class PradoUnitTestCase extends UnitTestCase {
}
+
/**
* Generate a class called MockTApplication to mock the TApplication class
* for the purpose of testing IModule objects.
*/
__autoload("TApplication");
Mock::generate("TApplication");
-
+
/**
* ModuleTestCase class.
*
@@ -75,7 +76,7 @@ class ModuleTestCase extends PradoUnitTestCase {
public function __construct() {
$file = "";
- $tihs->mockApplication =& new MockTApplication($file);
+ $tihs->mockApplication = new MockTApplication($file);
}
public function testGetSetID() {
@@ -103,5 +104,4 @@ class ModuleTestCase extends PradoUnitTestCase {
}
}
-
?> \ No newline at end of file
diff --git a/tests/UnitTests/framework/index.php b/tests/UnitTests/framework/index.php
index 9d745e23..54706599 100644
--- a/tests/UnitTests/framework/index.php
+++ b/tests/UnitTests/framework/index.php
@@ -23,7 +23,7 @@ class TestFolder
}
else if(is_file($fullpath) && strncmp($entry,'ut',2)===0)
{
- $this->testFiles[$entry]="$rootUri?target=".strtr(substr($fullpath,strlen($rootPath)+1),"\\",'/');
+ $this->testFiles[$entry]="$rootUri/index.php?target=".strtr(substr($fullpath,strlen($rootPath)+1),"\\",'/');
}
}
closedir($dir);
@@ -65,20 +65,22 @@ if(isset($_GET['target']))
$fullpath=realpath("$rootPath/$target");
if($fullpath===false || strpos($fullpath,$rootPath)!==0)
die('invalid test target');
-
- require_once($rootPath.'/common.php');
-
+ include_once($rootPath.'/common.php');
+
if(is_dir($fullpath))
{
+
$test=new GroupTest(basename($rootPath)."/$target");
addTests($test,$fullpath,$recursive);
- $test->run(new HtmlReporterWithCoverage(__FILE__,$rootPath));
+ $test->run(new HtmlReporter());
+ //$test->run(new HtmlReporterWithCoverage('index.php',$rootPath));
}
else
{
$testClass=basename($fullpath,'.php');
- require_once($fullpath);
+ include_once($fullpath);
$test=new $testClass(basename($rootPath)."/$target");
+
$test->run(new HtmlReporter());
}
}