Page MenuHomeDevCentral

RomanNumeralsTest.php
No OneTemporary

RomanNumeralsTest.php

<?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

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)

Event Timeline