Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7404307
BigTest.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
BigTest.php
View Options
<?php
namespace
MediaWiki\Extension\Math\Tests\WikiTexVC\Nodes
;
use
ArgumentCountError
;
use
MediaWiki\Extension\Math\WikiTexVC\Nodes\Big
;
use
MediaWiki\Extension\Math\WikiTexVC\Nodes\Literal
;
use
MediaWikiUnitTestCase
;
use
RuntimeException
;
use
TypeError
;
/**
* @covers \MediaWiki\Extension\Math\WikiTexVC\Nodes\Big
*/
class
BigTest
extends
MediaWikiUnitTestCase
{
public
function
testEmptyBig
()
{
$this
->
expectException
(
ArgumentCountError
::
class
);
new
Big
();
throw
new
ArgumentCountError
(
'Should not create an empty big'
);
}
public
function
testOneArgumentBig
()
{
$this
->
expectException
(
ArgumentCountError
::
class
);
new
Big
(
'
\\
big'
);
throw
new
ArgumentCountError
(
'Should not create a big with one argument'
);
}
public
function
testIncorrectTypeBig
()
{
$this
->
expectException
(
TypeError
::
class
);
new
Big
(
'
\\
big'
,
new
Literal
(
'a'
)
);
throw
new
RuntimeException
(
'Should not create a big with incorrect type'
);
}
public
function
testBasicFunctionBig
()
{
$big
=
new
Big
(
'
\\
big'
,
'a'
);
$this
->
assertEquals
(
'{
\\
big a}'
,
$big
->
render
(),
'Should create a basic function'
);
}
public
function
testGetters
()
{
$big
=
new
Big
(
'
\\
big'
,
'a'
);
$this
->
assertNotEmpty
(
$big
->
getArg
()
);
$this
->
assertNotEmpty
(
$big
->
getFname
()
);
}
public
function
testExtractIdentifiersBig
()
{
$big
=
new
Big
(
'
\\
big'
,
'a'
);
$this
->
assertEquals
(
[],
$big
->
extractIdentifiers
(),
'Should extract identifiers'
);
}
public
function
testCurliesBig
()
{
$big
=
new
Big
(
'
\\
big'
,
'a'
);
$this
->
assertEquals
(
'{
\\
big a}'
,
$big
->
inCurlies
(),
'Should create exactly one set of curlies'
);
}
public
function
testRenderMML
()
{
$big
=
new
Big
(
'
\\
big'
,
'a'
);
$this
->
assertStringContainsString
(
'</mrow>'
,
$big
->
renderMML
(),
'Should render to MathML'
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Nov 21, 19:06 (1 d, 1 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
6c/a8/c0cac88cabfd4ee9379578b41d26
Default Alt Text
BigTest.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment