Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4094524
MathLegacyIntegrationTest.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
MathLegacyIntegrationTest.php
View Options
<?php
namespace
MediaWiki\Extension\Math\Tests\ParsoidHandlers
;
use
MediaWiki\Extension\Math\Hooks\MathFormulaPostRenderRevisionHook
;
use
MediaWiki\Extension\Math\MathConfig
;
use
MediaWiki\Extension\Math\Tests\HookIntegrationSetupTrait
;
use
MediaWiki\Parser\ParserOptions
;
use
MediaWiki\Title\Title
;
use
MediaWikiIntegrationTestCase
;
/**
* @group Database
* @covers \MediaWiki\Extension\Math\HookHandlers\ParserHooksHandler
* @coversDefaultClass \MediaWiki\Extension\Math\HookHandlers\ParserHooksHandler
*/
class
MathLegacyIntegrationTest
extends
MediaWikiIntegrationTestCase
implements
MathFormulaPostRenderRevisionHook
{
use
HookIntegrationSetupTrait
;
public
function
testParsoidRendering
()
{
$this
->
setupTestEnviroment
();
$wt
=
'<math>TEST_FORMULA_1</math> <math>TEST_FORMULA_2</math>'
;
$title
=
Title
::
newFromText
(
'TestPage'
);
$parserOptions
=
ParserOptions
::
newCanonical
(
'canonical'
);
$parserOptions
->
setOption
(
'math'
,
MathConfig
::
MODE_SOURCE
);
$parser
=
$this
->
getServiceContainer
()->
getParserFactory
()->
getInstance
();
$output
=
$parser
->
parse
(
$wt
,
$title
,
$parserOptions
);
$html
=
$output
->
getRawText
();
$this
->
assertStringContainsString
(
'source:TEST_FORMULA_1:modified'
,
$html
);
$this
->
assertStringContainsString
(
'source:TEST_FORMULA_2:modified'
,
$html
);
$this
->
assertMathHookFiredAll
(
[
'<render>source:TEST_FORMULA_1</render>'
,
'<render>source:TEST_FORMULA_2</render>'
]
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Aug 18, 13:21 (4 w, 1 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
7e/be/78a98eae7aaec4a67a53c3b221f8
Default Alt Text
MathLegacyIntegrationTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment