From: Platonides Date: Fri, 28 Oct 2011 15:02:10 +0000 (+0000) Subject: Follow-up r99909. If there is a preprocessToXml method, use that. X-Git-Tag: 1.31.0-rc.0~26849 X-Git-Url: https://git.cyclocoop.org/%7B%7B%20url_for%28?a=commitdiff_plain;h=6ee7039b29048d14b26eed82cd5626031de73459;p=lhc%2Fweb%2Fwiklou.git Follow-up r99909. If there is a preprocessToXml method, use that. 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 --- diff --git a/tests/phpunit/includes/parser/PreprocessorTest.php b/tests/phpunit/includes/parser/PreprocessorTest.php index a396480567..e8c0c0ec42 100644 --- a/tests/phpunit/includes/parser/PreprocessorTest.php +++ b/tests/phpunit/includes/parser/PreprocessorTest.php @@ -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();