r95175 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95174‎ | r95175 | r95176 >
Date:19:28, 21 August 2011
Author:bawolff
Status:ok
Tags:
Comment:
follow-up r95171 - add unit test for tracking categories.
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/ExtraParserTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/ExtraParserTest.php
@@ -134,4 +134,20 @@
135135 'finalTitle' => $title,
136136 'deps' => $deps );
137137 }
 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+ }
138154 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r95171Follow-up r86534 - Do not add tracking categories if we're looking at a speci...bawolff18:46, 21 August 2011

Status & tagging log