<?php
+/**
+ * @covers WikiTextStructure
+ */
class WikitextStructureTest extends MediaWikiLangTestCase {
private function getMockTitle() {
/**
* Get parser output for Wiki text
- * @param $text
+ * @param string $text
* @return ParserOutput
*/
private function getParserOutput( $text ) {
/**
* Get WikitextStructure for given text
- * @param $text
+ * @param string $text
* @return WikiTextStructure
*/
private function getStructure( $text ) {
$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 ==