3 * @covers BadTitleError
6 class BadTitleErrorTest
extends MediaWikiTestCase
{
8 public function testExceptionSetsStatusCode() {
9 $this->setMwGlobals( 'wgOut', $this->getMockWgOut() );
11 throw new BadTitleError();
12 } catch ( BadTitleError
$e ) {
15 $text = ob_get_clean();
16 $this->assertContains( $e->getText(), $text );
20 private function getMockWgOut() {
21 $mock = $this->getMockBuilder( OutputPage
::class )
22 ->disableOriginalConstructor()
24 $mock->expects( $this->once() )
25 ->method( 'setStatusCode' )