Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12944284
RomanNumeralsTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
RomanNumeralsTest.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
Keruald\OmniTools\Tests\Culture\Rome
;
use
Keruald\OmniTools\Culture\Rome\RomanNumerals
;
use
PHPUnit\Framework\TestCase
;
use
InvalidArgumentException
;
class
RomanNumeralsTest
extends
TestCase
{
/**
* @dataProvider provideRomanAndHinduArabicNumerals
*/
public
function
testFromHindiArabicNumeral
(
string
$roman
,
int
$hinduArabic
)
:
void
{
$this
->
assertEquals
(
$roman
,
RomanNumerals
::
fromHinduArabic
(
$hinduArabic
)
);
}
public
function
provideRomanAndHinduArabicNumerals
()
:
iterable
{
yield
[
'i'
,
1
];
yield
[
'xi'
,
11
];
yield
[
'xlii'
,
42
];
yield
[
'mcmxcix'
,
1999
];
yield
[
'mm'
,
2000
];
}
public
function
testFromHindiArabicNumeralWithNegativeNumbers
()
:
void
{
$this
->
expectException
(
InvalidArgumentException
::
class
);
RomanNumerals
::
fromHinduArabic
(-
1
);
}
public
function
testFromHindiArabicNumeralWithZero
()
:
void
{
$this
->
expectException
(
InvalidArgumentException
::
class
);
RomanNumerals
::
fromHinduArabic
(
0
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Nov 18, 17:11 (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3163543
Default Alt Text
RomanNumeralsTest.php (1 KB)
Attached To
Mode
rKOT Keruald OmniTools
Attached
Detach File
Event Timeline
Log In to Comment