http://www.mediawiki.org/wiki/Special:Code/MediaWiki/95175

Revision: 95175
Author:   bawolff
Date:     2011-08-21 19:28:35 +0000 (Sun, 21 Aug 2011)
Log Message:
-----------
follow-up r95171 - add unit test for tracking categories.

Modified Paths:
--------------
    trunk/phase3/tests/phpunit/includes/ExtraParserTest.php

Modified: trunk/phase3/tests/phpunit/includes/ExtraParserTest.php
===================================================================
--- trunk/phase3/tests/phpunit/includes/ExtraParserTest.php     2011-08-21 
19:20:58 UTC (rev 95174)
+++ trunk/phase3/tests/phpunit/includes/ExtraParserTest.php     2011-08-21 
19:28:35 UTC (rev 95175)
@@ -134,4 +134,20 @@
                        'finalTitle' => $title,
                        'deps' => $deps );
        }
+       function testTrackingCategory() {
+               $title = Title::newFromText( __FUNCTION__ );
+               $catName =  wfMsgForContent( 'broken-file-category' );
+               $cat = Title::makeTitleSafe( NS_CATEGORY, $catName );
+               $expected = array( $cat->getDBkey() );
+               $parserOutput = $this->parser->parse( "[[file:nonexistent]]" , 
$title, $this->options );
+               $result = $parserOutput->getCategoryLinks();
+               $this->assertEquals( $expected, $result );
+       }
+       function testTrackingCategorySpecial() {
+               // Special pages shouldn't have tracking cats.
+               $title = SpecialPage::getTitleFor( 'Contributions' );
+               $parserOutput = $this->parser->parse( "[[file:nonexistent]]" , 
$title, $this->options );
+               $result = $parserOutput->getCategoryLinks();
+               $this->assertEmpty( $result );
+       }
  }


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to