Page MenuHomeWickedGov Phorge

BadTitleErrorTest.php
No OneTemporary

Size
656 B
Referenced Files
None
Subscribers
None

BadTitleErrorTest.php

<?php
use MediaWiki\Exception\BadTitleError;
use MediaWiki\Output\OutputPage;
/**
* @covers \MediaWiki\Exception\BadTitleError
* @author Addshore
*/
class BadTitleErrorTest extends MediaWikiIntegrationTestCase {
public function testExceptionSetsStatusCode() {
$mockOut = $this->createMock( OutputPage::class );
$mockOut->expects( $this->once() )
->method( 'setStatusCode' )
->with( 404 );
$this->setMwGlobals( 'wgOut', $mockOut );
try {
throw new BadTitleError();
} catch ( BadTitleError $e ) {
ob_start();
$e->report();
$text = ob_get_clean();
$this->assertStringContainsString( $e->getMessage(), $text );
}
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, Oct 3, 21:39 (1 w, 1 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
33/27/868895e498f980349457af29e369
Default Alt Text
BadTitleErrorTest.php (656 B)

Event Timeline