Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7402918
Fun1nbTest.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
Fun1nbTest.php
View Options
<?php
namespace
MediaWiki\Extension\Math\Tests\WikiTexVC\Nodes
;
use
ArgumentCountError
;
use
MediaWiki\Extension\Math\WikiTexVC\Nodes\Fun1nb
;
use
MediaWiki\Extension\Math\WikiTexVC\Nodes\Literal
;
use
MediaWikiUnitTestCase
;
use
TypeError
;
/**
* @covers \MediaWiki\Extension\Math\WikiTexVC\Nodes\Fun1nb
*/
class
Fun1nbTest
extends
MediaWikiUnitTestCase
{
public
function
testEmptyFun1nb
()
{
$this
->
expectException
(
ArgumentCountError
::
class
);
new
Fun1nb
();
throw
new
ArgumentCountError
(
'Should not create an empty fun1nb'
);
}
public
function
testOneArgumentFun1nb
()
{
$this
->
expectException
(
ArgumentCountError
::
class
);
new
Fun1nb
(
'
\\
f'
);
throw
new
ArgumentCountError
(
'Should not create a fun1nb with one argument'
);
}
public
function
testIncorrectTypeFun1nb
()
{
$this
->
expectException
(
TypeError
::
class
);
new
Fun1nb
(
'
\\
f'
,
'x'
);
throw
new
TypeError
(
'Should not create a fun1nb with incorrect type'
);
}
public
function
testBasicFunctionFun1nb
()
{
$fun1nb
=
new
Fun1nb
(
'
\\
f'
,
new
Literal
(
'a'
)
);
$this
->
assertEquals
(
'
\\
f {a} '
,
$fun1nb
->
render
(),
'Should create a basic function'
);
}
public
function
testGetters
()
{
$fun1nb
=
new
Fun1nb
(
'
\\
f'
,
new
Literal
(
'a'
)
);
$this
->
assertNotEmpty
(
$fun1nb
->
getFname
()
);
$this
->
assertNotEmpty
(
$fun1nb
->
getArg
()
);
}
public
function
testCurliesFun1nb
()
{
$f
=
new
Fun1nb
(
'
\\
f'
,
new
Literal
(
'a'
)
);
$this
->
assertEquals
(
'{
\\
f {a} }'
,
$f
->
inCurlies
(),
'Should create exactly one set of curlies'
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Nov 21, 18:20 (19 h, 4 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
59/58/e228d33def8fcd23d412b4532fd4
Default Alt Text
Fun1nbTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment