cvs: pear /PHPUnit2/Tests/Extensions OutputTestCaseTest.php /PHPUnit2/Tests/_files OutputTestCase.php

From: Date: Sun, 05 Mar 2006 21:31:12 +0000
Subject: cvs: pear /PHPUnit2/Tests/Extensions OutputTestCaseTest.php /PHPUnit2/Tests/_files OutputTestCase.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-38936@lists.php.net to get a copy of this message
sebastian Sun Mar 5 21:31:12 2006 UTC Modified files: /pear/PHPUnit2/Tests/Extensions OutputTestCaseTest.php /pear/PHPUnit2/Tests/_files OutputTestCase.php Log: More tests for PHPUnit2_Extensions_OutputTestCase. http://cvs.php.net/viewcvs.cgi/pear/PHPUnit2/Tests/Extensions/OutputTestCaseTest.php?r1=1.2&r2=1.3&diff_format=u Index: pear/PHPUnit2/Tests/Extensions/OutputTestCaseTest.php diff -u pear/PHPUnit2/Tests/Extensions/OutputTestCaseTest.php:1.2 pear/PHPUnit2/Tests/Extensions/OutputTestCaseTest.php:1.3 --- pear/PHPUnit2/Tests/Extensions/OutputTestCaseTest.php:1.2 Sun Mar 5 07:37:16 2006 +++ pear/PHPUnit2/Tests/Extensions/OutputTestCaseTest.php Sun Mar 5 21:31:12 2006 @@ -41,7 +41,7 @@ * @author Sebastian Bergmann <sb@sebastian-bergmann.de> * @copyright 2002-2006 Sebastian Bergmann <sb@sebastian-bergmann.de> * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: OutputTestCaseTest.php,v 1.2 2006/03/05 07:37:16 sebastian Exp $ + * @version CVS: $Id: OutputTestCaseTest.php,v 1.3 2006/03/05 21:31:12 sebastian Exp $ * @link http://pear.php.net/package/PHPUnit2 * @since File available since Release 3.0.0 */ @@ -64,18 +64,36 @@ */ class Extensions_OutputTestCaseTest extends PHPUnit2_Framework_TestCase { - public function testExpectFooActualFoo() + public function testExpectOutputStringFooActualFoo() { - $test = new OutputTestCase('testExpectFooActualFoo'); + $test = new OutputTestCase('testExpectOutputStringFooActualFoo'); $result = $test->run(); $this->assertEquals(1, $result->runCount()); $this->assertTrue($result->wasSuccessful()); } - public function testExpectFooActualBar() + public function testExpectOutputStringFooActualBar() { - $test = new OutputTestCase('testExpectFooActualBar'); + $test = new OutputTestCase('testExpectOutputStringFooActualBar'); + $result = $test->run(); + + $this->assertEquals(1, $result->runCount()); + $this->assertFalse($result->wasSuccessful()); + } + + public function testExpectOutputRegexFooActualFoo() + { + $test = new OutputTestCase('testExpectOutputRegexFooActualFoo'); + $result = $test->run(); + + $this->assertEquals(1, $result->runCount()); + $this->assertTrue($result->wasSuccessful()); + } + + public function testExpectOutputRegexFooActualBar() + { + $test = new OutputTestCase('testExpectOutputRegexFooActualBar'); $result = $test->run(); $this->assertEquals(1, $result->runCount()); http://cvs.php.net/viewcvs.cgi/pear/PHPUnit2/Tests/_files/OutputTestCase.php?r1=1.3&r2=1.4&diff_format=u Index: pear/PHPUnit2/Tests/_files/OutputTestCase.php diff -u pear/PHPUnit2/Tests/_files/OutputTestCase.php:1.3 pear/PHPUnit2/Tests/_files/OutputTestCase.php:1.4 --- pear/PHPUnit2/Tests/_files/OutputTestCase.php:1.3 Sun Mar 5 07:37:17 2006 +++ pear/PHPUnit2/Tests/_files/OutputTestCase.php Sun Mar 5 21:31:12 2006 @@ -41,7 +41,7 @@ * @author Sebastian Bergmann <sb@sebastian-bergmann.de> * @copyright 2002-2006 Sebastian Bergmann <sb@sebastian-bergmann.de> * @license http://www.opensource.org/licenses/bsd-license.php BSD License - * @version CVS: $Id: OutputTestCase.php,v 1.3 2006/03/05 07:37:17 sebastian Exp $ + * @version CVS: $Id: OutputTestCase.php,v 1.4 2006/03/05 21:31:12 sebastian Exp $ * @link http://pear.php.net/package/PHPUnit2 * @since File available since Release 2.0.0 */ @@ -66,17 +66,29 @@ */ class OutputTestCase extends PHPUnit2_Extensions_OutputTestCase { - public function testExpectFooActualFoo() + public function testExpectOutputStringFooActualFoo() { $this->expectOutputString('foo'); print 'foo'; } - public function testExpectFooActualBar() + public function testExpectOutputStringFooActualBar() { $this->expectOutputString('foo'); print 'bar'; } + + public function testExpectOutputRegexFooActualFoo() + { + $this->expectOutputRegex('/foo/'); + print 'foo'; + } + + public function testExpectOutputRegexFooActualBar() + { + $this->expectOutputRegex('/foo/'); + print 'bar'; + } } /*

« previous php.pear.cvs (#38936) next »