Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5980992
BadTitleErrorTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
656 B
Referenced Files
None
Subscribers
None
BadTitleErrorTest.php
View Options
<?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
Details
Attached
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)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment