Switch on expected value, since the actual one can obviously be wrong
authorjeroendedauw <jeroendedauw@gmail.com>
Mon, 24 Sep 2012 13:14:28 +0000 (15:14 +0200)
committerjeroendedauw <jeroendedauw@gmail.com>
Mon, 24 Sep 2012 13:15:43 +0000 (15:15 +0200)
This gets rid of confusing error messages pointing to the provided type being invalid

Change-Id: Id283ef6e8fa6c3f18bc9ef3b740e8ec4bd181e3a

tests/phpunit/MediaWikiTestCase.php

index 1cc45e0..f9e9f77 100644 (file)
@@ -536,7 +536,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
         * @param string $message
         */
        protected function assertType( $type, $actual, $message = '' ) {
-               if ( is_object( $actual ) ) {
+               if ( class_exists( $type ) || interface_exists( $type ) ) {
                        $this->assertInstanceOf( $type, $actual, $message );
                }
                else {