From 2d040d68ad1f427c401efe97299b5de4e0dab14b Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Sat, 23 Oct 2010 17:28:39 +0000 Subject: [PATCH] Update documentation a bit more. --- maintenance/tests/phpunit/includes/SampleTest.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/maintenance/tests/phpunit/includes/SampleTest.php b/maintenance/tests/phpunit/includes/SampleTest.php index ee91ec4f43..eba4d7bfed 100644 --- a/maintenance/tests/phpunit/includes/SampleTest.php +++ b/maintenance/tests/phpunit/includes/SampleTest.php @@ -26,7 +26,7 @@ class TestSample extends PHPUnit_Framework_TestCase { /** * If you want to run a the same test with a variety of data. use a data provider. - * See: http://www.phpunit.de/manual/3.4/en/writing-tests-for-phpunit.html + * see: http://www.phpunit.de/manual/3.4/en/writing-tests-for-phpunit.html */ public function provideTitles() { return array( @@ -40,6 +40,7 @@ class TestSample extends PHPUnit_Framework_TestCase { /** * @dataProvider provideTitles() + * See http://www.phpunit.de/manual/3.4/en/appendixes.annotations.html#appendixes.annotations.dataProvider */ public function testTitleCreation($titleName, $ns, $text) { $title = Title::newFromText($titleName, $ns); @@ -66,17 +67,20 @@ class TestSample extends PHPUnit_Framework_TestCase { */ /** * @depends testInitialCreation + * See http://www.phpunit.de/manual/3.4/en/appendixes.annotations.html#appendixes.annotations.depends */ public function testTitleDepends( $title ) { $this->assertTrue( $title->isLocal() ); } + /** + * If the code you're testing can produce Exceptions, you can also + * test for them. In the following example, the test expects a + * MWException containing the string "object" in the message.. + */ /** * @expectedException MWException object - * - * Above comment tells PHPUnit to expect an exception of the - * MWException class containing the string "object" in the - * message. + * See http://www.phpunit.de/manual/3.4/en/appendixes.annotations.html#appendixes.annotations.expectedException */ function testException() { $title = Title::newFromText(new Title("test")); -- 2.20.1