public function __construct($deviceList)
{
// define our name, and our description
$this->setName('device');
$this->setShortDescription('set the device (e.g. browser) to test with');
$this->setLongDesc("If you have multiple devices listed in your configuration files, " . "you can use this switch to choose which device to use when your test " . "runs. If you omit this switch, Storyplayer will default to using " . "your local copy of Google Chrome as the default device." . PHP_EOL . PHP_EOL . "See http://datasift.github.io/storyplayer/ " . "for how to configure and use multiple devices.");
// what are the short switches?
$this->addShortSwitch('d');
$this->addShortSwitch('b');
// what are the long switches?
$this->addLongSwitch('device');
$this->addLongSwitch('webbrowser');
// do we have any devices defined?
$msg = "the device to test with";
$deviceNames = $deviceList->getEntryNames();
if (count($deviceNames)) {
$msg .= "; one of: " . implode(", ", $deviceNames);
} else {
// no devices found
$msg .= ". You current have no devices listed in your config files.";
}
// what is the required argument?
$this->setRequiredArg('<device>', $msg);
// how do we validate this argument?
$this->setArgValidator(new Feature_DeviceValidator($deviceList));
// chrome is our default device
$this->setArgHasDefaultValueOf('chrome');
// all done
}