zoe Sun May 17 19:57:26 2009 UTC
Modified files:
/phpruntests/src/testcase rtPhpTest.php
/phpruntests/tests/testcase rtPhpTestTest.php
/phpruntests/src/testcase/sections/executablesections
rtFileSection.php
Log:
move ===done=== processing to parse()) in rtPhpTtest
http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/rtPhpTest.php?r1=1.6&r2=1.7&diff_format=u
Index: phpruntests/src/testcase/rtPhpTest.php
diff -u phpruntests/src/testcase/rtPhpTest.php:1.6
phpruntests/src/testcase/rtPhpTest.php:1.7
--- phpruntests/src/testcase/rtPhpTest.php:1.6 Thu May 14 19:56:30 2009
+++ phpruntests/src/testcase/rtPhpTest.php Sun May 17 19:57:26 2009
@@ -44,7 +44,10 @@
$tempArray = array();
for ($j=$i+1; $j<count($this->contents); $j++) {
- if ($this->isSectionKey($this->contents[$j])) {
+ if ($this->isSectionKey($this->contents[$j]) ||
stripos($this->contents[$j], "===done===") !== false) {
+ if(stripos($this->contents[$j], "===done===") !==
false) {
+ $tempArray[] = trim($this->contents[$j]);
+ }
$testSection = rtSection::getInstance($sectionKey,
$tempArray);
$this->sections[$sectionKey] = $testSection;
break;
@@ -56,6 +59,7 @@
$testSection = rtSection::getInstance($sectionKey, $tempArray);
$this->sections[$sectionKey] = $testSection;
+
//Identify the file and expect section types
$this->fileSection = $this->setFileSection();
http://cvs.php.net/viewvc.cgi/phpruntests/tests/testcase/rtPhpTestTest.php?r1=1.3&r2=1.4&diff_format=u
Index: phpruntests/tests/testcase/rtPhpTestTest.php
diff -u phpruntests/tests/testcase/rtPhpTestTest.php:1.3
phpruntests/tests/testcase/rtPhpTestTest.php:1.4
--- phpruntests/tests/testcase/rtPhpTestTest.php:1.3 Wed May 13 01:48:37 2009
+++ phpruntests/tests/testcase/rtPhpTestTest.php Sun May 17 19:57:26 2009
@@ -15,6 +15,8 @@
'<?php',
' echo "hello world"; ',
'?>',
+ '===Done===',
+ 'blah blah blah',
'EXPECTF',
'hello world',
);
@@ -41,5 +43,16 @@
$this->assertEquals('rtFileSection',
get_class($test->getSection('FILE')));
$this->assertEquals('rtExpectFSection',
get_class($test->getSection('EXPECTF')));
}
+
+ public function testDone()
+ {
+ $config = rtRuntestsConfiguration::getInstance(array('run-tests.php',
'-p', $this->php, 'test.phpt'));
+ $config->configure();
+
+ $test = new rtPhpTest($this->testCase, 'nameOfTest', array('TEST',
'FILE', 'EXPECTF'), $config);
+
+ // var_dump($test->getSection('FILE'));
+
+ }
}
?>
http://cvs.php.net/viewvc.cgi/phpruntests/src/testcase/sections/executablesections/rtFileSection.php?r1=1.11&r2=1.12&diff_format=u
Index: phpruntests/src/testcase/sections/executablesections/rtFileSection.php
diff -u
phpruntests/src/testcase/sections/executablesections/rtFileSection.php:1.11
phpruntests/src/testcase/sections/executablesections/rtFileSection.php:1.12
--- phpruntests/src/testcase/sections/executablesections/rtFileSection.php:1.11
Sun May 17 12:30:59 2009
+++ phpruntests/src/testcase/sections/executablesections/rtFileSection.php
Sun May 17 19:57:26 2009
@@ -23,16 +23,6 @@
}
protected function init() {
- $contents = array();
- foreach($this->sectionContents as $line) {
- if(stripos($line, "===done===") === false) {
- $contents[] = $line;
- } else {
- $contents[] = $line;
- $this->sectionContents = $contents;
- break;
- }
- }
}
public function run(rtPhpTest $testCase, rtRuntestsConfiguration
$runConfiguration)
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php