zoe Sun Jul 5 22:07:33 2009 UTC Modified files: /phpruntests/tests/testcase rtPhpTestTest.php Log: test for pasring done sections http://cvs.php.net/viewvc.cgi/phpruntests/tests/testcase/rtPhpTestTest.php?r1=1.7&r2=1.8&diff_format=u Index: phpruntests/tests/testcase/rtPhpTestTest.php diff -u phpruntests/tests/testcase/rtPhpTestTest.php:1.7 phpruntests/tests/testcase/rtPhpTestTest.php:1.8 --- phpruntests/tests/testcase/rtPhpTestTest.php:1.7 Sun Jul 5 17:22:58 2009 +++ phpruntests/tests/testcase/rtPhpTestTest.php Sun Jul 5 22:07:33 2009 @@ -19,7 +19,27 @@ '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 @@ $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); + + } }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php