From 5356dbd180a5ae277acd1bfbb185d7328176143d Mon Sep 17 00:00:00 2001 From: jeroendedauw Date: Mon, 24 Sep 2012 15:14:28 +0200 Subject: [PATCH] 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 --- tests/phpunit/MediaWikiTestCase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 { -- 2.20.1