From: Umherirrender Date: Tue, 19 Feb 2019 20:19:31 +0000 (+0100) Subject: Do not suppress php notices in SpecialPageFatalTest X-Git-Tag: 1.34.0-rc.0~2399^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles%22%2C%22id_article=%24id_article%22%29%20.%20%22?a=commitdiff_plain;h=4743ab9efc9c6ac7e02f7689844e1bc1a13b475f;p=lhc%2Fweb%2Fwiklou.git Do not suppress php notices in SpecialPageFatalTest When the php notice is converted to exception, it is also from type Exception and currently ignored. Catch the special phpunit exception type separated and rethrow. This changed is in a structure test and can break other exceptions. Change-Id: I8fb26380724b6b12bf08458dbff2e00b759d219b --- diff --git a/tests/phpunit/structure/SpecialPageFatalTest.php b/tests/phpunit/structure/SpecialPageFatalTest.php index c08fe2fc7f..97797cacf6 100644 --- a/tests/phpunit/structure/SpecialPageFatalTest.php +++ b/tests/phpunit/structure/SpecialPageFatalTest.php @@ -32,8 +32,14 @@ class SpecialPageFatalTest extends MediaWikiTestCase { try { $executor->executeSpecialPage( $page, '', null, null, $user ); + } catch ( \PHPUnit\Framework\Error\Error $error ) { + // Let phpunit settings working: + // - convertErrorsToExceptions="true" + // - convertNoticesToExceptions="true" + // - convertWarningsToExceptions="true" + throw $error; } catch ( Exception $e ) { - // Exceptions are allowed + // Other exceptions are allowed } // If the page fataled phpunit will have already died