Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7406830
Fun2nbTest.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
Fun2nbTest.php
View Options
<?php
namespace
MediaWiki\Extension\Math\Tests\WikiTexVC\Nodes
;
use
ArgumentCountError
;
use
MediaWiki\Extension\Math\WikiTexVC\Nodes\Fun2nb
;
use
MediaWiki\Extension\Math\WikiTexVC\Nodes\Literal
;
use
MediaWikiUnitTestCase
;
use
TypeError
;
/**
* @covers \MediaWiki\Extension\Math\WikiTexVC\Nodes\Fun2nb
*/
class
Fun2nbTest
extends
MediaWikiUnitTestCase
{
public
function
testEmptyFun2nb
()
{
$this
->
expectException
(
ArgumentCountError
::
class
);
new
Fun2nb
();
throw
new
ArgumentCountError
(
'Should not create an empty fun2nb'
);
}
public
function
testOneArgumentFun2nb
()
{
$this
->
expectException
(
ArgumentCountError
::
class
);
new
Fun2nb
(
'
\\
f'
);
throw
new
ArgumentCountError
(
'Should not create a fun2nb with one argument'
);
}
public
function
testIncorrectTypeFun2nb
()
{
$this
->
expectException
(
TypeError
::
class
);
new
Fun2nb
(
'
\\
f'
,
'x'
,
'y'
);
throw
new
TypeError
(
'Should not create a fun2nb with incorrect type'
);
}
public
function
testBasicFunctionFun2nb
()
{
$fq
=
new
Fun2nb
(
'
\\
f'
,
new
Literal
(
'a'
),
new
Literal
(
'b'
)
);
$this
->
assertEquals
(
'
\\
f {a}{b}'
,
$fq
->
render
(),
'Should create a basic function'
);
}
public
function
testCurliesFun2nb
()
{
$f
=
new
Fun2nb
(
'
\\
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, 20:37 (1 d, 10 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ee/9d/93da6cfb6fcbeb4aefc5e1f4afda
Default Alt Text
Fun2nbTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment