GlobalCommandOptionCest.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. class GlobalCommandOptionCest
  3. {
  4. public function configOption(CliGuy $I)
  5. {
  6. $I->wantTo("start codeception with --config option");
  7. $I->amInPath('tests/data/register_command/');
  8. $I->executeCommand('--config standard/codeception.yml');
  9. $I->seeInShellOutput('myProject:myCommand');
  10. }
  11. public function configOptionWithEqualSign(CliGuy $I)
  12. {
  13. $I->wantTo("start codeception with --config= option");
  14. $I->amInPath('tests/data/register_command/');
  15. $I->executeCommand('--config=standard/codeception.yml');
  16. $I->seeInShellOutput('myProject:myCommand');
  17. }
  18. public function configOptionShortcut(CliGuy $I)
  19. {
  20. $I->wantTo("start codeception with shortcut -c option");
  21. $I->amInPath('tests/data/register_command/');
  22. $I->executeCommand('-c standard/codeception.yml');
  23. $I->seeInShellOutput('myProject:myCommand');
  24. }
  25. public function configOptionShortcutWithoutSpace(CliGuy $I)
  26. {
  27. $I->wantTo("start codeception with shortcut -c option and not Space");
  28. $I->amInPath('tests/data/register_command/');
  29. $I->executeCommand('-cstandard/codeception.yml');
  30. $I->seeInShellOutput('myProject:myCommand');
  31. }
  32. public function configOptionShortcutWithoutSpaceAndOther(CliGuy $I)
  33. {
  34. $I->wantTo("start codeception with two shortcuts and -c option has not Space");
  35. $I->amInPath('tests/data/register_command/');
  36. $I->executeCommand('-vcstandard/codeception.yml');
  37. $I->seeInShellOutput('version');
  38. }
  39. public function configStartWithoutOption(CliGuy $I)
  40. {
  41. $I->wantTo("start first time codeception without options");
  42. $I->amInPath('tests/data/register_command/');
  43. $I->executeCommand('');
  44. $I->seeInShellOutput('Available commands:');
  45. }
  46. public function configStartWithWrongPath(CliGuy $I)
  47. {
  48. $I->wantTo('start codeception with wrong path to a codeception.yml file');
  49. $I->amInPath('tests/data/register_command/');
  50. $I->executeFailCommand('-c no/exists/codeception.yml');
  51. $I->seeInShellOutput('Your configuration file `no/exists/codeception.yml` could not be found.');
  52. }
  53. }