3 * @covers BadTitleError
4 * @author Adam Shorland
6 class BadTitleErrorTest
extends MediaWikiTestCase
{
10 protected function setUp() {
13 $this->wgOut
= clone $wgOut;
16 protected function tearDown() {
19 $wgOut = $this->wgOut
;
22 public function testExceptionSetsStatusCode() {
24 $wgOut = $this->getMockWgOut();
26 throw new BadTitleError();
28 catch( BadTitleError
$e ) {
30 $this->assertTrue( true );
34 private function getMockWgOut() {
35 $mock = $this->getMockBuilder( 'OutputPage' )
36 ->disableOriginalConstructor()
38 $mock->expects( $this->once() )
39 ->method( 'setStatusCode' )