}
public function report() {
- global $wgOut;
-
- $wgOut->showErrorPage( $this->title, $this->msg, $this->params );
- $wgOut->output();
+ if ( self::isCommandLine() || defined( 'MW_API' ) ) {
+ parent::report();
+ } else {
+ global $wgOut;
+ $wgOut->showErrorPage( $this->title, $this->msg, $this->params );
+ $wgOut->output();
+ }
}
}
$mock->expects( $this->once() )
->method( 'output' );
$this->setMwGlobals( 'wgOut', $mock );
+ $this->setMwGlobals( 'wgCommandLineMode', false );
$e = new ErrorPageError( $title, $mockMessage, $params );
$e->report();