Avoid dumping big stack traces from unit tests.
authordaniel <daniel.kinzler@wikimedia.de>
Tue, 13 Mar 2018 19:32:18 +0000 (20:32 +0100)
committerdaniel <daniel.kinzler@wikimedia.de>
Tue, 13 Mar 2018 19:54:06 +0000 (20:54 +0100)
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

tests/phpunit/includes/import/ImportLinkCacheIntegrationTest.php

index bdb4831..076924c 100644 (file)
@@ -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()
                );