| @@ 64-94 (lines=31) @@ | ||
| 61 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License |
|
| 62 | * @link http://datasift.github.io/storyplayer |
|
| 63 | */ |
|
| 64 | class Feature_PersistDeviceSwitch extends CliSwitch |
|
| 65 | { |
|
| 66 | public function __construct() |
|
| 67 | { |
|
| 68 | // define our name, and our description |
|
| 69 | $this->setName('persistdevice'); |
|
| 70 | $this->setShortDescription('do not auto-kill the test device between phases'); |
|
| 71 | $this->setLongDesc( |
|
| 72 | "Use this switch if you want the test device (such as a web browser) to remain open " |
|
| 73 | ."between your test phases." |
|
| 74 | . PHP_EOL . PHP_EOL |
|
| 75 | ."Be aware that if the test device times out and shuts itself down during one of " |
|
| 76 | ."your phases, your test *is* going to fail, because Storyplayer has no way to " |
|
| 77 | ."detect that your test device has gone away by itself." |
|
| 78 | ); |
|
| 79 | ||
| 80 | // what are the long switches? |
|
| 81 | $this->addLongSwitch('persist-device'); |
|
| 82 | ||
| 83 | // all done |
|
| 84 | } |
|
| 85 | ||
| 86 | public function process(CliEngine $engine, $invokes = 1, $params = array(), $isDefaultParam = false) |
|
| 87 | { |
|
| 88 | // remember the setting |
|
| 89 | $engine->options->persistDevice = true; |
|
| 90 | ||
| 91 | // tell the engine that it is done |
|
| 92 | return new CliResult(CliResult::PROCESS_CONTINUE); |
|
| 93 | } |
|
| 94 | } |
|
| @@ 64-96 (lines=33) @@ | ||
| 61 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License |
|
| 62 | * @link http://datasift.github.io/storyplayer |
|
| 63 | */ |
|
| 64 | class Feature_PersistTargetSwitch extends CliSwitch |
|
| 65 | { |
|
| 66 | public function __construct() |
|
| 67 | { |
|
| 68 | // define our name, and our description |
|
| 69 | $this->setName('persisttarget'); |
|
| 70 | $this->setShortDescription('do not destroy the test environment after the test'); |
|
| 71 | $this->setLongDesc( |
|
| 72 | "Use this switch if you want the test environment to continue to exist " |
|
| 73 | ."after Storyplayer has finished running." |
|
| 74 | . PHP_EOL . PHP_EOL |
|
| 75 | ."Use the --reuse-target switch on subsequent runs to avoid rebuilding the " |
|
| 76 | ."test environment." |
|
| 77 | ); |
|
| 78 | ||
| 79 | // what are the short switches? |
|
| 80 | $this->addShortSwitch('P'); |
|
| 81 | ||
| 82 | // what are the long switches? |
|
| 83 | $this->addLongSwitch('persist-target'); |
|
| 84 | ||
| 85 | // all done |
|
| 86 | } |
|
| 87 | ||
| 88 | public function process(CliEngine $engine, $invokes = 1, $params = array(), $isDefaultParam = false) |
|
| 89 | { |
|
| 90 | // remember the setting |
|
| 91 | $engine->options->persistTarget = true; |
|
| 92 | ||
| 93 | // tell the engine that it is done |
|
| 94 | return new CliResult(CliResult::PROCESS_CONTINUE); |
|
| 95 | } |
|
| 96 | } |
|
| @@ 65-97 (lines=33) @@ | ||
| 62 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License |
|
| 63 | * @link http://datasift.github.io/storyplayer |
|
| 64 | */ |
|
| 65 | class Feature_ReuseTargetSwitch extends CliSwitch |
|
| 66 | { |
|
| 67 | public function __construct() |
|
| 68 | { |
|
| 69 | // define our name, and our description |
|
| 70 | $this->setName('reusetarget'); |
|
| 71 | $this->setShortDescription('do not rebuild the test environment that we previously persisted'); |
|
| 72 | $this->setLongDesc( |
|
| 73 | "Use this switch if you want the test environment to continue to exist " |
|
| 74 | ."after Storyplayer has finished running." |
|
| 75 | . PHP_EOL . PHP_EOL |
|
| 76 | ."Use the --persist-target switch on the previous run to leave the " |
|
| 77 | ."test environment behind, so that you can then use this switch." |
|
| 78 | ); |
|
| 79 | ||
| 80 | // what are the short switches? |
|
| 81 | $this->addShortSwitch('R'); |
|
| 82 | ||
| 83 | // what are the long switches? |
|
| 84 | $this->addLongSwitch('reuse-target'); |
|
| 85 | ||
| 86 | // all done |
|
| 87 | } |
|
| 88 | ||
| 89 | public function process(CliEngine $engine, $invokes = 1, $params = array(), $isDefaultParam = false) |
|
| 90 | { |
|
| 91 | // remember the setting |
|
| 92 | $engine->options->reuseTarget = true; |
|
| 93 | ||
| 94 | // tell the engine that it is done |
|
| 95 | return new CliResult(CliResult::PROCESS_CONTINUE); |
|
| 96 | } |
|
| 97 | } |
|
| @@ 60-96 (lines=37) @@ | ||
| 57 | * @license http://www.opensource.org/licenses/bsd-license.php BSD License |
|
| 58 | * @link http://datasift.github.io/storyplayer |
|
| 59 | */ |
|
| 60 | class Feature_UbLangConsoleSwitch extends CliSwitch |
|
| 61 | { |
|
| 62 | public function __construct() |
|
| 63 | { |
|
| 64 | // define our name, and our description |
|
| 65 | $this->setName('ublang'); |
|
| 66 | $this->setShortDescription('use the Ubiquitous Language console'); |
|
| 67 | $this->setLongDesc( |
|
| 68 | "This switch changes Storyplayer's default output to the Ubiquitous Language console." |
|
| 69 | . " The UbLang console provides a more descriptive description of what each of your tests is doing." |
|
| 70 | . PHP_EOL . PHP_EOL |
|
| 71 | . "The full story log is also available in storyplayer.log." |
|
| 72 | ); |
|
| 73 | ||
| 74 | // what are the long switches? |
|
| 75 | $this->addLongSwitch('ublang'); |
|
| 76 | ||
| 77 | // all done |
|
| 78 | } |
|
| 79 | ||
| 80 | /** |
|
| 81 | * |
|
| 82 | * @param CliEngine $engine |
|
| 83 | * @param integer $invokes |
|
| 84 | * @param array $params |
|
| 85 | * @param boolean $isDefaultParam |
|
| 86 | * @return CliResult |
|
| 87 | */ |
|
| 88 | public function process(CliEngine $engine, $invokes = 1, $params = array(), $isDefaultParam = false) |
|
| 89 | { |
|
| 90 | // remember the setting |
|
| 91 | $engine->options->console = "UbLangConsole"; |
|
| 92 | ||
| 93 | // tell the engine that it is done |
|
| 94 | return new CliResult(CliResult::PROCESS_CONTINUE); |
|
| 95 | } |
|
| 96 | } |
|
| 97 | ||