Index: trunk/phase3/maintenance/tests/phpunit/includes/SampleTest.php |
— | — | @@ -26,7 +26,7 @@ |
27 | 27 | |
28 | 28 | /** |
29 | 29 | * If you want to run a the same test with a variety of data. use a data provider. |
30 | | - * See: http://www.phpunit.de/manual/3.4/en/writing-tests-for-phpunit.html |
| 30 | + * see: http://www.phpunit.de/manual/3.4/en/writing-tests-for-phpunit.html |
31 | 31 | */ |
32 | 32 | public function provideTitles() { |
33 | 33 | return array( |
— | — | @@ -40,6 +40,7 @@ |
41 | 41 | |
42 | 42 | /** |
43 | 43 | * @dataProvider provideTitles() |
| 44 | + * See http://www.phpunit.de/manual/3.4/en/appendixes.annotations.html#appendixes.annotations.dataProvider |
44 | 45 | */ |
45 | 46 | public function testTitleCreation($titleName, $ns, $text) { |
46 | 47 | $title = Title::newFromText($titleName, $ns); |
— | — | @@ -66,17 +67,20 @@ |
67 | 68 | */ |
68 | 69 | /** |
69 | 70 | * @depends testInitialCreation |
| 71 | + * See http://www.phpunit.de/manual/3.4/en/appendixes.annotations.html#appendixes.annotations.depends |
70 | 72 | */ |
71 | 73 | public function testTitleDepends( $title ) { |
72 | 74 | $this->assertTrue( $title->isLocal() ); |
73 | 75 | } |
74 | 76 | |
75 | 77 | /** |
| 78 | + * If the code you're testing can produce Exceptions, you can also |
| 79 | + * test for them. In the following example, the test expects a |
| 80 | + * MWException containing the string "object" in the message.. |
| 81 | + */ |
| 82 | + /** |
76 | 83 | * @expectedException MWException object |
77 | | - * |
78 | | - * Above comment tells PHPUnit to expect an exception of the |
79 | | - * MWException class containing the string "object" in the |
80 | | - * message. |
| 84 | + * See http://www.phpunit.de/manual/3.4/en/appendixes.annotations.html#appendixes.annotations.expectedException |
81 | 85 | */ |
82 | 86 | function testException() { |
83 | 87 | $title = Title::newFromText(new Title("test")); |