Index: trunk/phase3/tests/phpunit/includes/ExtraParserTest.php |
— | — | @@ -134,4 +134,20 @@ |
135 | 135 | 'finalTitle' => $title, |
136 | 136 | 'deps' => $deps ); |
137 | 137 | } |
| 138 | + function testTrackingCategory() { |
| 139 | + $title = Title::newFromText( __FUNCTION__ ); |
| 140 | + $catName = wfMsgForContent( 'broken-file-category' ); |
| 141 | + $cat = Title::makeTitleSafe( NS_CATEGORY, $catName ); |
| 142 | + $expected = array( $cat->getDBkey() ); |
| 143 | + $parserOutput = $this->parser->parse( "[[file:nonexistent]]" , $title, $this->options ); |
| 144 | + $result = $parserOutput->getCategoryLinks(); |
| 145 | + $this->assertEquals( $expected, $result ); |
| 146 | + } |
| 147 | + function testTrackingCategorySpecial() { |
| 148 | + // Special pages shouldn't have tracking cats. |
| 149 | + $title = SpecialPage::getTitleFor( 'Contributions' ); |
| 150 | + $parserOutput = $this->parser->parse( "[[file:nonexistent]]" , $title, $this->options ); |
| 151 | + $result = $parserOutput->getCategoryLinks(); |
| 152 | + $this->assertEmpty( $result ); |
| 153 | + } |
138 | 154 | } |