IntegrationShell.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * IntegrationShell file
  4. *
  5. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  6. * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  7. *
  8. * Licensed under The MIT License
  9. * For full copyright and license information, please see the LICENSE.txt
  10. * Redistributions of files must retain the above copyright notice
  11. *
  12. * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  13. * @link http://cakephp.org CakePHP(tm) Project
  14. * @since 1.5.0
  15. * @license http://www.opensource.org/licenses/mit-license.php MIT License
  16. */
  17. /**
  18. * IntegrationShell
  19. */
  20. namespace TestApp\Shell;
  21. use Cake\Console\Shell;
  22. class IntegrationShell extends Shell
  23. {
  24. /**
  25. * Bridge of Death question
  26. *
  27. * @return void
  28. */
  29. public function bridge()
  30. {
  31. $name = $this->in('What is your name');
  32. if ($name !== 'cake') {
  33. $this->err('No!');
  34. $this->_stop(Shell::CODE_ERROR);
  35. }
  36. $color = $this->in('What is your favorite color?');
  37. if ($color !== 'blue') {
  38. $this->err('Wrong! <blink>Aaaahh</blink>');
  39. $this->_stop(Shell::CODE_ERROR);
  40. }
  41. $this->out('You may pass.');
  42. }
  43. }