summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwei <>2006-07-06 23:45:54 +0000
committerwei <>2006-07-06 23:45:54 +0000
commit9bc0264b85f9b7bfdb0f9050acd7142f20fa1c13 (patch)
treeeda9057150919d3b9eecddd811c3b381d91f49c0
parentc9d52efd6cea119b228cdf4a5679463e06f98b50 (diff)
Update test tools.
-rwxr-xr-xframework/prado-cli.php22
-rw-r--r--tests/test_tools/selenium/core/TestRunner-splash.html2
-rw-r--r--tests/test_tools/selenium/php/TestRunner.php9
-rw-r--r--tests/test_tools/unit_tests.php2
4 files changed, 20 insertions, 15 deletions
diff --git a/framework/prado-cli.php b/framework/prado-cli.php
index 8d629140..1a0e5498 100755
--- a/framework/prado-cli.php
+++ b/framework/prado-cli.php
@@ -18,7 +18,7 @@ if($console->hasOptions())
{
if($dir = $console->getOption('create'))
create_new_prado_project($dir);
- if($console->getOptions('tests'))
+ if($console->getOption('tests'))
create_test_fixtures($dir);
}
else
@@ -102,7 +102,7 @@ function render_unit_test_fixture()
$tester = realpath(dirname(__FILE__).'/../tests/test_tools/unit_tests.php');
return '<?php
-include_once "'.$tester.'";
+include_once \''.$tester.'\';
$app_directory = "../protected";
$test_cases = dirname(__FILE__)."/unit";
@@ -118,7 +118,7 @@ function render_functional_test_fixture()
$tester = realpath(dirname(__FILE__).'/../tests/test_tools/functional_tests.php');
return '<?php
-include_once "'.$tester.'";
+include_once \''.$tester.'\';
$test_cases = dirname(__FILE__)."/functional";
@@ -131,7 +131,10 @@ $tester->run(new SimpleReporter());
function create_directory($dir, $mask)
{
if(!is_dir($dir))
+ {
mkdir($dir);
+ echo "creating $dir\n";
+ }
if(is_dir($dir))
chmod($dir, $mask);
}
@@ -139,7 +142,10 @@ function create_directory($dir, $mask)
function create_file($filename, $content)
{
if(!is_file($filename))
+ {
file_put_contents($filename, $content);
+ echo "creating $filename\n";
+ }
}
function render_index_file()
@@ -148,7 +154,7 @@ function render_index_file()
return '<?php
$basePath=dirname(__FILE__);
-$frameworkPath="'.$framework.'";
+$frameworkPath=\''.$framework.'\';
$assetsPath=$basePath."/assets";
$runtimePath=$basePath."/protected/runtime";
@@ -286,6 +292,7 @@ class ConsoleOptions
{
if(is_null($this->_values))
$this->_values = $this->getNamedOptions();
+
return isset($this->_values[$name]) ? $this->_values[$name] : null;
}
@@ -320,9 +327,10 @@ class ConsoleOptions
{
foreach($this->_options as $name => $option)
{
- if(strpos($option[0],$value[0]) !== false
- || strpos($option[1], $value[0]) !== false)
- $options[$name] = $value[1];
+ $short = str_replace(':', '', $option[0]);
+ $long = str_replace('=', '', $option[1]);
+ if($short == $value[0] || $long == $value[0])
+ $options[$name] = is_null($value[1]) ? true : $value[1];
}
}
return $options;
diff --git a/tests/test_tools/selenium/core/TestRunner-splash.html b/tests/test_tools/selenium/core/TestRunner-splash.html
index 368c95b7..205bb8ef 100644
--- a/tests/test_tools/selenium/core/TestRunner-splash.html
+++ b/tests/test_tools/selenium/core/TestRunner-splash.html
@@ -34,8 +34,6 @@ Copyright 2005 ThoughtWorks, Inc
<td></td>
<td class="selenium splash">
-<img src="selenium-logo.png" align="right">
-
<h1>Selenium</h1>
<h2>by <a href="http://www.thoughtworks.com">ThoughtWorks</a> and friends</h2>
diff --git a/tests/test_tools/selenium/php/TestRunner.php b/tests/test_tools/selenium/php/TestRunner.php
index 21d18e44..a82ce0dd 100644
--- a/tests/test_tools/selenium/php/TestRunner.php
+++ b/tests/test_tools/selenium/php/TestRunner.php
@@ -80,7 +80,7 @@ Copyright 2004 ThoughtWorks, Inc
<table class="layout">
<tr class="selenium">
<th width="25%" height="1" class="header">
- <h1><a href="http://selenium.thoughtworks.com" title="The Selenium Project">Selenium</a> TestRunner</h1>
+ <h3><a href="http://selenium.thoughtworks.com" title="The Selenium Project">Selenium</a></h3>
</th>
</tr>
<tr>
@@ -139,19 +139,18 @@ Copyright 2004 ThoughtWorks, Inc
<td>incomplete</td>
</tr>
</table>
-
+ <!--
<fieldset>
<legend>Tools</legend>
- <!--
<button type="button" id="domViewer1" onClick="openDomViewer();">
View DOM
- </button> -->
+ </button>
<button type="button" onClick="LOG.show();">
Show Log
</button>
</fieldset>
-
+ -->
</td>
</tr>
</table>
diff --git a/tests/test_tools/unit_tests.php b/tests/test_tools/unit_tests.php
index 5c1c95bd..732c6826 100644
--- a/tests/test_tools/unit_tests.php
+++ b/tests/test_tools/unit_tests.php
@@ -88,7 +88,7 @@ class PradoUnitTester
function run($reporter)
{
- $rootPath=$this->_root;
+ $rootPath=realpath($this->_root);
$rootUri=dirname($_SERVER['PHP_SELF']);
if(isset($_GET['target']))
{