CasesHelperTest.php 823 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. namespace morphos\test;
  3. use morphos\Cases;
  4. use morphos\CasesHelper;
  5. use PHPUnit\Framework\TestCase;
  6. class CasesHelperTest extends TestCase
  7. {
  8. /**
  9. * @dataProvider casesProvider
  10. */
  11. public function testCanonizeCase($short, $case)
  12. {
  13. $this->assertEquals($case, CasesHelper::canonizeCase($short));
  14. }
  15. public function casesProvider()
  16. {
  17. return [
  18. ['nominativus', Cases::NOMINATIVE],
  19. ['genetivus', Cases::GENITIVE],
  20. ['dativus', Cases::DATIVE],
  21. ['ablativus', Cases::ABLATIVE],
  22. ['praepositionalis', Cases::PREPOSITIONAL],
  23. ];
  24. }
  25. public function testCanonizeCaseInvalid()
  26. {
  27. $this->expectException(\InvalidArgumentException::class);
  28. CasesHelper::canonizeCase('Invalid-Case');
  29. }
  30. }