RegisterCommandCest.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. class RegisterCommandCest
  3. {
  4. public function registerCommand(CliGuy $I)
  5. {
  6. $I->amInPath('tests/data/register_command/standard');
  7. $I->executeCommand('list');
  8. $I->seeInShellOutput('myProject:myCommand');
  9. }
  10. public function registerCommandWithConfigurationAtNewPlace(CliGuy $I)
  11. {
  12. $I->amInPath('tests/data/register_command/');
  13. $I->executeCommand('list -c standard/codeception.yml');
  14. $I->seeInShellOutput('myProject:yourCommand');
  15. }
  16. public function startMyCommand(CliGuy $I)
  17. {
  18. $myname = get_current_user();
  19. $I->amInPath('tests/data/register_command/standard');
  20. $I->executeCommand('myProject:myCommand');
  21. $I->seeInShellOutput("Hello {$myname}!");
  22. }
  23. public function startMyCommandWithOptionAndConfigurationAtNewPlace(CliGuy $I)
  24. {
  25. $myname = get_current_user();
  26. $I->amInPath('tests/data/register_command');
  27. $I->executeCommand('myProject:myCommand --config standard/codeception.yml --friendly');
  28. $I->seeInShellOutput("Hello {$myname},");
  29. $I->seeInShellOutput("how are you?");
  30. }
  31. }