Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7415860
RenderTest.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
RenderTest.php
View Options
<?php
namespace
MediaWiki\Extension\Math\Tests\WikiTexVC
;
use
MediaWiki\Extension\Math\WikiTexVC\Parser
;
use
MediaWikiUnitTestCase
;
/**
* @covers \MediaWiki\Extension\Math\WikiTexVC\Parser
*/
class
RenderTest
extends
MediaWikiUnitTestCase
{
public
static
function
provideTestCases
()
{
return
[
[
'in'
=>
''
,
],
[
'in'
=>
'a'
,
],
[
'in'
=>
'a^2'
,
'out'
=>
'a^{2}'
],
[
'in'
=>
'a^2+b^{2}'
,
'out'
=>
'a^{2}+b^{2}'
],
[
'in'
=>
'a^{2}+b^{2}'
,
],
[
'in'
=>
'l_a^2+l_b^2=l_c^2'
,
'out'
=>
'l_{a}^{2}+l_{b}^{2}=l_{c}^{2}'
],
[
'in'
=>
'
\\
sin(x)+{}{}
\\
cos(x)^2 newcommand'
,
'out'
=>
'
\\
sin(x)+{}{}
\\
cos(x)^{2}newcommand'
]
];
}
/**
* @dataProvider provideTestCases
*/
public
function
testRendering
(
string
$in
,
?
string
$out
=
null
)
{
$parser
=
new
Parser
();
$out
??=
$in
;
$result
=
$parser
->
parse
(
$in
);
$rendered
=
$result
->
render
();
$this
->
assertSame
(
$out
,
$rendered
,
'Error rendering input: '
.
$in
.
' rendered output is: '
.
$rendered
.
' should be: '
.
$out
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 22, 02:24 (1 d, 11 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
1e/2c/12081d7a2c2975f29547f8db78a3
Default Alt Text
RenderTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment