com phpruntests: test for pasring done sections: tests/testcase/rtPhpTestTest.php
| From: | David Soria Parra | Date: | Sun, 05 Jul 2009 22:07:33 +0000 |
| Subject: | com phpruntests: test for pasring done sections: tests/testcase/rtPhpTestTest.php | ||
| Groups: | php.qa | ||
| Request: | Send a blank email to php-qa+get-66372@lists.php.net to get a copy of this message | ||
Commit: 7c68ac3af6b1aef32f396735dd469be4c536be8b
Author: Zoe Slattery <zoe@php.net> Sun, 5 Jul 2009 22:07:33 +0000
Parents: b01b87ed6cd34a35c955ae7ac58017529716ab10
Branches: master
Link: http://git.php.net/?p=phpruntests.git;a=commitdiff;h=7c68ac3af6b1aef32f396735dd469be4c536be8b
Log:
test for pasring done sections
Changed paths:
M tests/testcase/rtPhpTestTest.php
Diff:
diff --git a/tests/testcase/rtPhpTestTest.php b/tests/testcase/rtPhpTestTest.php
index 6f5e689..77b566b 100644
--- a/tests/testcase/rtPhpTestTest.php
+++ b/tests/testcase/rtPhpTestTest.php
@@ -19,7 +19,27 @@ class rtPhpTestTest extends PHPUnit_Framework_TestCase
'blah blah blah',
'--EXPECTF--',
'hello world',
+ '===Done===',
+ 'gah',
+ );
+
+ $this->testCase2 = array (
+ '--TEST--',
+ 'This is a test',
+ '--GET--',
+ '--POST--',
+ '--FILE--',
+ '<?php',
+ ' echo "hello world"; ',
+ '?>',
+ '===Done===',
+ 'blah blah blah',
+ '--EXPECTF--',
+ 'hello world',
+ '===Done===',
+ 'gah',
);
+
}
public function testCreateInstance()
@@ -54,7 +74,23 @@ class rtPhpTestTest extends PHPUnit_Framework_TestCase
$status = new rtTestStatus('nameOfTest');
$test = new rtPhpTest($this->testCase, 'nameOfTest', array('TEST',
'FILE', 'EXPECTF'), $config, $status);
- // var_dump($test->getSection('FILE'));
+ $contents = $test->getSection('FILE')->getContents();
+ $this->assertEquals('===Done===', end($contents));
+
+ $contents = $test->getSection('EXPECTF')->getContents();
+ $this->assertEquals('gah', end($contents));
+
+ }
+
+ public function testEmptySection()
+ {
+ $config = rtRuntestsConfiguration::getInstance(array('run-tests.php',
'-p', $this->php, 'test.phpt'));
+ $config->configure();
+
+ $status = new rtTestStatus('nameOfTest');
+ // $test = new rtPhpTest($this->testCase2, 'nameOfTest',
array('TEST', 'GET', 'POST', 'FILE', 'EXPECTF'),
$config, $status);
+
+
}
}