Merge "mw.rcfilters.ui.SaveFiltersPopupButtonWidget: Remove pointless option"
[lhc/web/wiklou.git] / tests / phpunit / includes / content / WikitextStructureTest.php
index 4301fb8..1bdbe01 100644 (file)
@@ -1,5 +1,8 @@
 <?php
 
+/**
+ * @covers WikiTextStructure
+ */
 class WikitextStructureTest extends MediaWikiLangTestCase {
 
        private function getMockTitle() {
@@ -8,7 +11,7 @@ class WikitextStructureTest extends MediaWikiLangTestCase {
 
        /**
         * Get parser output for Wiki text
-        * @param $text
+        * @param string $text
         * @return ParserOutput
         */
        private function getParserOutput( $text ) {
@@ -18,7 +21,7 @@ class WikitextStructureTest extends MediaWikiLangTestCase {
 
        /**
         * Get WikitextStructure for given text
-        * @param $text
+        * @param string $text
         * @return WikiTextStructure
         */
        private function getStructure( $text ) {
@@ -49,6 +52,19 @@ END;
                $this->assertContains( "Wikitext in Heading and also html", $headings );
        }
 
+       public function testDefaultSort() {
+               $text = <<<END
+Louise Michel
+== Heading one ==
+Some text
+==== See also ====
+* Also things to see!
+{{DEFAULTSORT:Michel, Louise}}
+END;
+               $struct = $this->getStructure( $text );
+               $this->assertEquals( "Michel, Louise", $struct->getDefaultSort() );
+       }
+
        public function testHeadingsFirst() {
                $text = <<<END
 == Heading one ==