From: jeroendedauw Date: Mon, 24 Sep 2012 13:14:28 +0000 (+0200) Subject: Switch on expected value, since the actual one can obviously be wrong X-Git-Tag: 1.31.0-rc.0~22296 X-Git-Url: https://git.cyclocoop.org/%7B%7B%20url_for%28?a=commitdiff_plain;h=5356dbd180a5ae277acd1bfbb185d7328176143d;p=lhc%2Fweb%2Fwiklou.git Switch on expected value, since the actual one can obviously be wrong This gets rid of confusing error messages pointing to the provided type being invalid Change-Id: Id283ef6e8fa6c3f18bc9ef3b740e8ec4bd181e3a --- diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php index 1cc45e087f..f9e9f77b30 100644 --- a/tests/phpunit/MediaWikiTestCase.php +++ b/tests/phpunit/MediaWikiTestCase.php @@ -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 {