InflectCommandTest.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. declare(strict_types = 1);
  3. namespace Tools\Test\TestCase\Command;
  4. use Cake\TestSuite\ConsoleIntegrationTestTrait;
  5. use Cake\TestSuite\TestCase;
  6. /**
  7. * Tools\Command\InflectCommand Test Case
  8. *
  9. * @uses \Tools\Command\InflectCommand
  10. */
  11. class InflectCommandTest extends TestCase {
  12. use ConsoleIntegrationTestTrait;
  13. /**
  14. * setUp method
  15. *
  16. * @return void
  17. */
  18. public function setUp(): void {
  19. parent::setUp();
  20. $this->useCommandRunner();
  21. }
  22. /**
  23. * Test execute method
  24. *
  25. * @return void
  26. */
  27. public function testExecute(): void {
  28. $this->exec('inflect FooBar all');
  29. $output = $this->_out->messages();
  30. $expected = [
  31. 0 => 'FooBar',
  32. 1 => 'Pluralized form : FooBars',
  33. 2 => 'Singular form : FooBar',
  34. 3 => 'CamelCase form : FooBar',
  35. 4 => 'under_scored_form : foo_bar',
  36. 5 => 'Human Readable Group form : FooBar',
  37. 6 => 'table_names form : foo_bars',
  38. 7 => 'Cake Model Class form : FooBar',
  39. 8 => 'variableForm : fooBar',
  40. 9 => 'Dasherized-form : foo-bar',
  41. ];
  42. $this->assertSame($expected, $output);
  43. }
  44. }