X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/mediawiki.git/blobdiff_plain/d57edfddd6c01f0ed6b1a84019649cdf6cddd5f8..83d871ca0d985c6d586b323bf96161afb510ebf6:/tests/phpunit/includes/exception/BadTitleErrorTest.php diff --git a/tests/phpunit/includes/exception/BadTitleErrorTest.php b/tests/phpunit/includes/exception/BadTitleErrorTest.php new file mode 100644 index 00000000..e6a18125 --- /dev/null +++ b/tests/phpunit/includes/exception/BadTitleErrorTest.php @@ -0,0 +1,28 @@ +setMwGlobals( 'wgOut', $this->getMockWgOut() ); + try { + throw new BadTitleError(); + } catch ( BadTitleError $e ) { + $e->report(); + $this->assertTrue( true ); + } + } + + private function getMockWgOut() { + $mock = $this->getMockBuilder( 'OutputPage' ) + ->disableOriginalConstructor() + ->getMock(); + $mock->expects( $this->once() ) + ->method( 'setStatusCode' ) + ->with( 400 ); + return $mock; + } + +}