Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7404630
Fun2sqTest.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
Fun2sqTest.php
View Options
<?php
namespace
MediaWiki\Extension\Math\Tests\WikiTexVC\Nodes
;
use
ArgumentCountError
;
use
MediaWiki\Extension\Math\WikiTexVC\Nodes\Fun2sq
;
use
MediaWiki\Extension\Math\WikiTexVC\Nodes\Literal
;
use
MediaWikiUnitTestCase
;
use
TypeError
;
/**
* @covers \MediaWiki\Extension\Math\WikiTexVC\Nodes\Fun2sq
*/
class
Fun2sqTest
extends
MediaWikiUnitTestCase
{
public
function
testEmptyFun2sq
()
{
$this
->
expectException
(
ArgumentCountError
::
class
);
new
Fun2sq
();
throw
new
ArgumentCountError
(
'Should not create an empty fun2sq'
);
}
public
function
testOneArgumentFun2sq
()
{
$this
->
expectException
(
ArgumentCountError
::
class
);
new
Fun2sq
(
'
\\
f'
);
throw
new
ArgumentCountError
(
'Should not create a fun2sq with one argument'
);
}
public
function
testIncorrectTypeFun2sq
()
{
$this
->
expectException
(
TypeError
::
class
);
new
Fun2sq
(
'
\\
f'
,
'x'
,
'y'
);
throw
new
TypeError
(
'Should not create a fun2sq with incorrect type'
);
}
public
function
testBasicFunctionFun2sq
()
{
$f
=
new
Fun2sq
(
'
\\
f'
,
new
Literal
(
'a'
),
new
Literal
(
'b'
)
);
$this
->
assertEquals
(
'{
\\
f[a]{b}}'
,
$f
->
render
(),
'Should create a basic function'
);
}
public
function
testCurliesFun2sq
()
{
$f
=
new
Fun2sq
(
'
\\
f'
,
new
Literal
(
'a'
),
new
Literal
(
'b'
)
);
$this
->
assertEquals
(
'{
\\
f[a]{b}}'
,
$f
->
inCurlies
(),
'Should create exactly one set of curlies'
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Nov 21, 19:16 (1 d, 2 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
d1/a6/fad2ae50e04ee661a62f42a2ada4
Default Alt Text
Fun2sqTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment