General cleanup of Parser tests
[lhc/web/wiklou.git] / tests / phpunit / includes / parser / PreprocessorTest.php
index 7e9c9d4..0d2e07e 100644 (file)
@@ -1,9 +1,16 @@
 <?php
 
 class PreprocessorTest extends MediaWikiTestCase {
-       var $mTitle = 'Page title';
-       var $mPPNodeCount = 0;
-       var $mOptions;
+       protected $mTitle = 'Page title';
+       protected $mPPNodeCount = 0;
+       /**
+        * @var ParserOptions
+        */
+       protected $mOptions;
+       /**
+        * @var Preprocessor
+        */
+       protected $mPreprocessor;
 
        protected function setUp() {
                global $wgParserConf, $wgContLang;
@@ -115,7 +122,7 @@ class PreprocessorTest extends MediaWikiTestCase {
         * @param string $wikiText
         * @return string
         */
-       function preprocessToXml( $wikiText ) {
+       protected function preprocessToXml( $wikiText ) {
                if ( method_exists( $this->mPreprocessor, 'preprocessToXml' ) ) {
                        return $this->normalizeXml( $this->mPreprocessor->preprocessToXml( $wikiText ) );
                }
@@ -134,14 +141,15 @@ class PreprocessorTest extends MediaWikiTestCase {
         * @param string $xml
         * @return string
         */
-       function normalizeXml( $xml ) {
+       protected function normalizeXml( $xml ) {
                return preg_replace( '!<([a-z]+)/>!', '<$1></$1>', str_replace( ' />', '/>', $xml ) );
        }
 
        /**
         * @dataProvider provideCases
+        * @covers Preprocessor_DOM::preprocessToXml
         */
-       function testPreprocessorOutput( $wikiText, $expectedXml ) {
+       public function testPreprocessorOutput( $wikiText, $expectedXml ) {
                $this->assertEquals( $this->normalizeXml( $expectedXml ), $this->preprocessToXml( $wikiText ) );
        }
 
@@ -160,8 +168,9 @@ class PreprocessorTest extends MediaWikiTestCase {
 
        /**
         * @dataProvider provideFiles
+        * @covers Preprocessor_DOM::preprocessToXml
         */
-       function testPreprocessorOutputFiles( $filename ) {
+       public function testPreprocessorOutputFiles( $filename ) {
                $folder = __DIR__ . "/../../../parser/preprocess";
                $wikiText = file_get_contents( "$folder/$filename.txt" );
                $output = $this->preprocessToXml( $wikiText );
@@ -222,6 +231,7 @@ class PreprocessorTest extends MediaWikiTestCase {
 
        /**
         * @dataProvider provideHeadings
+        * @covers Preprocessor_DOM::preprocessToXml
         */
        function testHeadings( $wikiText, $expectedXml ) {
                $this->assertEquals( $this->normalizeXml( $expectedXml ), $this->preprocessToXml( $wikiText ) );