CardinalNumeralTest.php 706 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace morphos\test\English;
  3. use morphos\English\CardinalNumeralGenerator;
  4. use PHPUnit\Framework\TestCase;
  5. class CardinalNumeralTest extends TestCase
  6. {
  7. /**
  8. * @dataProvider numbersProvider
  9. */
  10. public function testGeneration($number, $cardinal)
  11. {
  12. $this->assertEquals($cardinal, CardinalNumeralGenerator::generate($number));
  13. }
  14. public function numbersProvider()
  15. {
  16. return [
  17. [132, 'one hundred thirty-two'],
  18. [2595410, 'two million, five hundred ninety-five thousand, four hundred ten'],
  19. [2021123132, 'two billion, twenty-one million, one hundred twenty-three thousand, one hundred thirty-two'],
  20. ];
  21. }
  22. }