getMockMessage(); $title = 'Foo'; $params = [ 'Baz' ]; $e = new ErrorPageError( $title, $mockMessage, $params ); $this->assertEquals( $title, $e->title ); $this->assertEquals( $mockMessage, $e->msg ); $this->assertEquals( $params, $e->params ); } public function testReport() { $mockMessage = $this->getMockMessage(); $title = 'Foo'; $params = [ 'Baz' ]; $mock = $this->createMock( OutputPage::class ); $mock->expects( $this->once() ) ->method( 'showErrorPage' ) ->with( $title, $mockMessage, $params ); $mock->expects( $this->once() ) ->method( 'output' ); $this->setMwGlobals( [ 'wgOut' => $mock, 'wgCommandLineMode' => false, ] ); $e = new ErrorPageError( $title, $mockMessage, $params ); $e->report(); } }