Follow up r79107 for old PHPUnit versions.
authorPlatonides <platonides@users.mediawiki.org>
Wed, 29 Dec 2010 15:21:25 +0000 (15:21 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Wed, 29 Dec 2010 15:21:25 +0000 (15:21 +0000)
tests/phpunit/bootstrap.php

index 15b517c..0b6ff9b 100644 (file)
@@ -192,8 +192,16 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
        }
 
        function __call( $func, $args ) {
+               static $compatibility = array(
+                       'assertInternalType' => 'assertType',
+                       'assertNotInternalType' => 'assertNotType',
+                       'assertInstanceOf' => 'assertType',
+               );
+
                if ( method_exists( $this->suite, $func ) ) {
                        return call_user_func_array( array( $this->suite, $func ), $args);
+               } elseif ( isset( $compatibility[$func] ) ) {
+                       return call_user_func_array( array( $this, $compatibility[$func] ), $args);
                } else {
                        throw new MWException( "Called non-existant $func method on "
                                . get_class( $this ) );