com phpruntests: Redirecttest implementation - set status to redirected: src/testcase/rtTestStatus.php
src/testcase/sections/executablesections/rtSkipIfSection.php src/testcase/sections/rtSection.php src/testgroup/rtPhpTestGroup.php
src/testrun/rtPhpTestRun.php
| From: | Zoe Slattery | Date: | Sun, 20 May 2012 16:29:09 +0000 |
| Subject: | com phpruntests: Redirecttest implementation - set status to redirected: src/testcase/rtTestStatus.php src/testcase/sections/executablesections/rtSkipIfSection.php src/testcase/sections/rtSection.php src/testgroup/rtPhpTestGroup.php src/testrun/rtPhpTestRun.php |
||
| Groups: | php.qa | ||
| Request: | Send a blank email to php-qa+get-66588@lists.php.net to get a copy of this message | ||
Commit: 56369c55651f06d411397928900c8c9ce1e64652
Author: zoe slattery <zoe@php.net> Sun, 20 May 2012 17:29:09 +0100
Parents: 24d08e775107faf433cff1a9f862994ecae7c028
Branches: master
Link: http://git.php.net/?p=phpruntests.git;a=commitdiff;h=56369c55651f06d411397928900c8c9ce1e64652
Log:
Redirecttest implementation - set status to redirected
Changed paths:
M src/testcase/rtTestStatus.php
M src/testcase/sections/executablesections/rtSkipIfSection.php
M src/testcase/sections/rtSection.php
M src/testgroup/rtPhpTestGroup.php
M src/testrun/rtPhpTestRun.php
Diff:
diff --git a/src/testcase/rtTestStatus.php b/src/testcase/rtTestStatus.php
index 466012e..0a4504b 100644
--- a/src/testcase/rtTestStatus.php
+++ b/src/testcase/rtTestStatus.php
@@ -29,6 +29,7 @@ class rtTestStatus {
'fail_headers',
'pass_headers',
'leak',
+ 'redirected',
);
public function __construct($testName)
diff --git a/src/testcase/sections/executablesections/rtSkipIfSection.php
b/src/testcase/sections/executablesections/rtSkipIfSection.php
index 8d3a95e...4b20834 100644
--- a/src/testcase/sections/executablesections/rtSkipIfSection.php
+++ b/src/testcase/sections/executablesections/rtSkipIfSection..php
@@ -48,7 +48,7 @@ class rtSkipIfSection extends rtExecutableSection
try {
$this->output = $PhpRunner->runphp();
-
+
if (!strncasecmp('skip', ltrim($this->output), 4)) {
$testStatus->setTrue('skip');
if (preg_match('/^\s*skip\s*(.+)\s*/i', $this->output, $matches)) {
diff --git a/src/testcase/sections/rtSection.php b/src/testcase/sections/rtSection.php
index 659de31..e6c99a8 100644
--- a/src/testcase/sections/rtSection.php
+++ b/src/testcase/sections/rtSection.php
@@ -61,7 +61,6 @@ abstract class rtSection
public static function getInstance($sectionName, $contents, $testName)
{
if (!isset(self::$sectionMap[$sectionName])) {
- var_dump($testName);
throw new rtException('Unknown section type ' . $sectionName);
}
diff --git a/src/testgroup/rtPhpTestGroup.php b/src/testgroup/rtPhpTestGroup.php
index 5203656..b995119 100644
--- a/src/testgroup/rtPhpTestGroup.php
+++ b/src/testgroup/rtPhpTestGroup.php
@@ -52,6 +52,9 @@ class rtPhpTestGroup
} elseif (in_array("REDIRECTTEST",$testFile->getSectionHeadings())){
//Redirect handler, save the test case for processing after the main groups have
finished.
$this->redirectedTestCases[] = new rtPhpTest($testFile->getContents(),
$testFile->getTestName(), $testFile->getSectionHeadings(), $runConfiguration, $testStatus);
+ $testStatus->setTrue('redirected');
+ $testStatus->setMessage('redirected', $testFile->getExitMessage());
+ $this->results[] = new rtTestResults(null, $testStatus);
}else {
$testStatus->setTrue('bork');
$testStatus->setMessage('bork', $testFile->getExitMessage());
diff --git a/src/testrun/rtPhpTestRun.php b/src/testrun/rtPhpTestRun.php
index 1ab880b..4e24632 100644
--- a/src/testrun/rtPhpTestRun.php
+++ b/src/testrun/rtPhpTestRun.php
@@ -162,11 +162,13 @@ class rtPhpTestRun
$results->processResults($testCase, $runConfiguration);
} elseif (in_array("REDIRECTTEST",
$testFile->getSectionHeadings())) {
+
//Redirect handler
+
$testCase = new rtPhpTest($testFile->getContents(), $testFile->getTestName(),
$testFile->getSectionHeadings(), $runConfiguration, $testStatus);
- echo "Not executed, will need to redirect:
".$testCase->getName()."\n";
- $testStatus->setTrue('bork');
- $testStatus->setMessage('bork',
$testFile->getExitMessage());
+
+ $testStatus->setTrue('redirected');
+ $testStatus->setMessage('redirected',
$testFile->getExitMessage());
$results = new rtTestResults(null, $testStatus);
} else {
$testStatus->setTrue('bork');