Follow-up r99909. If there is a preprocessToXml method, use that.
authorPlatonides <platonides@users.mediawiki.org>
Fri, 28 Oct 2011 15:02:10 +0000 (15:02 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Fri, 28 Oct 2011 15:02:10 +0000 (15:02 +0000)
Some preprocessor could have preprocessToObj as a native type.

PHP Fatal error:  Call to a member function __toString() on a non-object in phase3/tests/phpunit/includes/parser/PreprocessorTest.php on line 119

tests/phpunit/includes/parser/PreprocessorTest.php

index a396480..e8c0c0e 100644 (file)
@@ -112,6 +112,10 @@ class PreprocessorTest extends MediaWikiTestCase {
         * @return string
         */
        function preprocessToXml( $wikiText ) {
+               if ( method_exists( $this->mPreprocessor, 'preprocessToXml' ) ) {
+                       return $this->normalizeXml( $this->mPreprocessor->preprocessToXml( $wikiText ) );
+               }
+               
                $dom = $this->mPreprocessor->preprocessToObj( $wikiText );
                if ( is_callable( array( $dom, 'saveXML' ) ) ) {
                        return $dom->saveXML();