Merge "(bug 41476) Implement Language::isKnownLanguageTag()"
[lhc/web/wiklou.git] / tests / phpunit / MediaWikiPHPUnitCommand.php
index fca3251..3894435 100644 (file)
@@ -6,9 +6,11 @@ class MediaWikiPHPUnitCommand extends PHPUnit_TextUI_Command {
                'regex=' => false,
                'file=' => false,
                'use-filebackend=' => false,
+               'use-bagostuff=' => false,
                'keep-uploads' => false,
                'use-normal-tables' => false,
                'reuse-db' => false,
+               'wiki=' => false,
        );
 
        public function __construct() {
@@ -53,6 +55,26 @@ class MediaWikiPHPUnitCommand extends PHPUnit_TextUI_Command {
                }
        }
 
+       public function run( array $argv, $exit = true ) {
+               wfProfileIn( __METHOD__ );
+
+               $ret = parent::run( $argv, false );
+
+               wfProfileOut( __METHOD__ );
+
+               // Return to real wiki db, so profiling data is preserved
+               MediaWikiTestCase::teardownTestDB();
+
+               // Log profiling data, e.g. in the database or UDP
+               wfLogProfilingData();
+
+               if ( $exit ) {
+                       exit( $ret );
+               } else {
+                       return $ret;
+               }
+       }
+
        public function showHelp() {
                parent::showHelp();