Added release notes for 'ContentHandler::runLegacyHooks' removal
[mediawiki.git] / tests / phpunit / includes / exception / BadTitleErrorTest.php
blobe6a1812584dad52a20185197ada4f507ffa31d87
1 <?php
2 /**
3 * @covers BadTitleError
4 * @author Addshore
5 */
6 class BadTitleErrorTest extends MediaWikiTestCase {
8 public function testExceptionSetsStatusCode() {
9 $this->setMwGlobals( 'wgOut', $this->getMockWgOut() );
10 try {
11 throw new BadTitleError();
12 } catch ( BadTitleError $e ) {
13 $e->report();
14 $this->assertTrue( true );
18 private function getMockWgOut() {
19 $mock = $this->getMockBuilder( 'OutputPage' )
20 ->disableOriginalConstructor()
21 ->getMock();
22 $mock->expects( $this->once() )
23 ->method( 'setStatusCode' )
24 ->with( 400 );
25 return $mock;