NounPluralizationTest.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. namespace morphos\test\English;
  3. use morphos\English\NounPluralization;
  4. use PHPUnit\Framework\TestCase;
  5. class NounPluralizationTest extends TestCase
  6. {
  7. /**
  8. * @dataProvider wordsProvider
  9. */
  10. public function testPluralization($word, $pluralized)
  11. {
  12. $this->assertEquals($pluralized, NounPluralization::pluralize($word, 2));
  13. }
  14. public function wordsProvider()
  15. {
  16. return [
  17. ['ship', 'ships'],
  18. ['gun', 'guns'],
  19. ['boy', 'boys'],
  20. ['class', 'classes'],
  21. ['box', 'boxes'],
  22. ['torpedo', 'torpedoes'],
  23. ['army', 'armies'],
  24. ['navy', 'navies'],
  25. ['wolf', 'wolves'],
  26. ['knife', 'knives'],
  27. ['chief', 'chiefs'],
  28. ['basis', 'bases'],
  29. ['crisis', 'crises'],
  30. ['radius', 'radii'],
  31. ['nucleus', 'nuclei'],
  32. ['curriculum', 'curricula'],
  33. ['man', 'men'],
  34. ['woman', 'women'],
  35. ['child', 'children'],
  36. ['foot', 'feet'],
  37. ['tooth', 'teeth'],
  38. ['ox', 'oxen'],
  39. ['goose', 'geese'],
  40. ['mouse', 'mice'],
  41. ['schoolboy', 'schoolboys'],
  42. ['knowledge', 'knowledge'],
  43. ['progress', 'progress'],
  44. ['advice', 'advice'],
  45. ['ink', 'ink'],
  46. ['money', 'money'],
  47. ['scissors', 'scissors'],
  48. ['spectacles', 'spectacles'],
  49. ['trousers', 'trousers'],
  50. ];
  51. }
  52. }