Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4117627
ThrottledErrorTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
601 B
Referenced Files
None
Subscribers
None
ThrottledErrorTest.php
View Options
<?php
use
MediaWiki\Output\OutputPage
;
/**
* @covers \ThrottledError
* @author Addshore
*/
class
ThrottledErrorTest
extends
MediaWikiIntegrationTestCase
{
public
function
testExceptionSetsStatusCode
()
{
$mockOut
=
$this
->
createMock
(
OutputPage
::
class
);
$mockOut
->
expects
(
$this
->
once
()
)
->
method
(
'setStatusCode'
)
->
with
(
429
);
$this
->
setMwGlobals
(
'wgOut'
,
$mockOut
);
try
{
throw
new
ThrottledError
();
}
catch
(
ThrottledError
$e
)
{
ob_start
();
$e
->
report
();
$text
=
ob_get_clean
();
$this
->
assertStringContainsString
(
$e
->
getMessage
(),
$text
);
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, Aug 19, 02:17 (2 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
82/64/c7656526710fa37aceb6cc797837
Default Alt Text
ThrottledErrorTest.php (601 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment