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();
27 } catch ( BadTitleError
$e ) {
29 $this->assertTrue( true );
33 private function getMockWgOut() {
34 $mock = $this->getMockBuilder( 'OutputPage' )
35 ->disableOriginalConstructor()
37 $mock->expects( $this->once() )
38 ->method( 'setStatusCode' )