Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7414114
ChemFun2uTest.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
ChemFun2uTest.php
View Options
<?php
namespace
MediaWiki\Extension\Math\Tests\WikiTexVC\Nodes
;
use
ArgumentCountError
;
use
MediaWiki\Extension\Math\WikiTexVC\Nodes\ChemFun2u
;
use
MediaWiki\Extension\Math\WikiTexVC\Nodes\Literal
;
use
MediaWikiUnitTestCase
;
use
TypeError
;
/**
* @covers \MediaWiki\Extension\Math\WikiTexVC\Nodes\ChemFun2u
*/
class
ChemFun2uTest
extends
MediaWikiUnitTestCase
{
public
function
testEmptyChemFun2u
()
{
$this
->
expectException
(
ArgumentCountError
::
class
);
new
ChemFun2u
();
throw
new
ArgumentCountError
(
'Should not create an empty ChemFun2u'
);
}
public
function
testOneArgumentChemFun2u
()
{
$this
->
expectException
(
ArgumentCountError
::
class
);
new
ChemFun2u
(
'a'
);
throw
new
ArgumentCountError
(
'Should not create a ChemFun2u with one argument'
);
}
public
function
testIncorrectTypeChemFun2u
()
{
$this
->
expectException
(
TypeError
::
class
);
new
ChemFun2u
(
'a'
,
'b'
,
'c'
);
throw
new
TypeError
(
'Should not create a ChemFun2u with incorrect type'
);
}
public
function
testBasicChemFun2u
()
{
$fun2u
=
new
ChemFun2u
(
'a'
,
new
Literal
(
'b'
),
new
Literal
(
'c'
)
);
$this
->
assertEquals
(
'a{b}_{c}'
,
$fun2u
->
render
(),
'Should create a basic ChemFun2u'
);
}
public
function
testGetters
()
{
$fun2u
=
new
ChemFun2u
(
'a'
,
new
Literal
(
'b'
),
new
Literal
(
'c'
)
);
$this
->
assertNotEmpty
(
$fun2u
->
getFname
()
);
$this
->
assertNotEmpty
(
$fun2u
->
getLeft
()
);
$this
->
assertNotEmpty
(
$fun2u
->
getRight
()
);
}
public
function
testExtractIdentifiers
()
{
$fun2u
=
new
ChemFun2u
(
'a'
,
new
Literal
(
'b'
),
new
Literal
(
'c'
)
);
$this
->
assertEquals
(
[],
$fun2u
->
extractIdentifiers
(),
'Should extract identifiers'
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 22, 01:24 (1 d, 16 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
7a/78/4ee1d5be5456b470ac7eee210bd2
Default Alt Text
ChemFun2uTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment