Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5979155
RenderDebugInfoTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
RenderDebugInfoTest.php
View Options
<?php
namespace
MediaWiki\Tests\OutputTransform\Stages
;
use
MediaWiki\Config\ServiceOptions
;
use
MediaWiki\OutputTransform\OutputTransformStage
;
use
MediaWiki\OutputTransform\Stages\RenderDebugInfo
;
use
MediaWiki\Parser\ParserOutput
;
use
MediaWiki\Tests\OutputTransform\OutputTransformStageTestBase
;
use
Psr\Log\NullLogger
;
/**
* @covers \MediaWiki\OutputTransform\Stages\RenderDebugInfo
*/
class
RenderDebugInfoTest
extends
OutputTransformStageTestBase
{
public
function
createStage
():
OutputTransformStage
{
return
new
RenderDebugInfo
(
new
ServiceOptions
(
[]
),
new
NullLogger
(),
$this
->
getServiceContainer
()->
getHookContainer
()
);
}
public
function
provideShouldRun
():
array
{
return
[
[
new
ParserOutput
(),
null
,
[
'includeDebugInfo'
=>
true
]
],
];
}
public
function
provideShouldNotRun
():
array
{
return
[
[
new
ParserOutput
(),
null
,
[]
],
[
new
ParserOutput
(),
null
,
[
'includeDebugInfo'
=>
false
]
],
];
}
/**
* TODO this only covers the addition of the report, not the content of the report itself. Expanding this
* test may be a good idea.
*/
public
function
provideTransform
():
array
{
$text
=
<<<EOF
<!DOCTYPE html>
<html><head><title>Main Page</title></head><body data-parsoid='{"dsr":[0,6,0,0]}' lang="en"><p data-parsoid='{"dsr":[0,5,0,0]}'>hello</p>
</body></html>
EOF;
$expectedText
=
$text
.
"
\n
<!--
\n
NewPP limit report
\n
Complications: []
\n
-->
\n
"
;
$po
=
new
ParserOutput
(
$text
);
$po
->
setLimitReportData
(
'test'
,
'limit'
);
$expected
=
new
ParserOutput
(
$expectedText
);
$expected
->
setLimitReportData
(
'test'
,
'limit'
);
return
[
[
$po
,
null
,
[],
$expected
],
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 20:46 (4 d, 9 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
15/cb/575af86e8f4ca76d726420f20b34
Default Alt Text
RenderDebugInfoTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment