From 9c1d8a970921c4741b6c2351d5d4ecefd0be09a7 Mon Sep 17 00:00:00 2001 From: daniel Date: Tue, 13 Mar 2018 20:32:18 +0100 Subject: [PATCH] Avoid dumping big stack traces from unit tests. Using assertFalse( $exception ) results in potentially very large stack trace dumps, when $exception is an exception from deep inside MediaWiki. Stack trace dumps include a dump of all parameters, resulting in console output of (in my case) over 160 MB. Change-Id: Ib78493d86531844a892586c071b2fa631ad765eb --- .../import/ImportLinkCacheIntegrationTest.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/tests/phpunit/includes/import/ImportLinkCacheIntegrationTest.php b/tests/phpunit/includes/import/ImportLinkCacheIntegrationTest.php index bdb4831a93..076924c87c 100644 --- a/tests/phpunit/includes/import/ImportLinkCacheIntegrationTest.php +++ b/tests/phpunit/includes/import/ImportLinkCacheIntegrationTest.php @@ -89,20 +89,11 @@ class ImportLinkCacheIntegrationTest extends MediaWikiTestCase { $reporter->setContext( new RequestContext() ); $reporter->open(); - $exception = false; - try { - $importer->doImport(); - } catch ( Exception $e ) { - $exception = $e; - } + $importer->doImport(); $result = $reporter->close(); - $this->assertFalse( - $exception - ); - $this->assertTrue( $result->isGood() ); -- 2.20.1