protected function _applyOptionsAndFlags($options, $flags) { if (is_array($options)) { foreach ($options as $opt) { if (is_string($opt)) { switch ($opt) { case 'recursive': $this->_recursive = true; break; case 'use-hash-postfix': $this->_useHashFilePostfix = true; break; case 'selenium2': $this->_converter->useSelenium2(); break; default: print "Unknown option \"{$opt}\".\n"; exit(1); } } else { if (is_array($opt)) { switch ($opt[0]) { case 'php-prefix': $this->_phpFilePrefix = $opt[1]; break; case 'php-postfix': $this->_phpFilePostfix = $opt[1]; break; case 'browser': $this->_converter->setBrowser($opt[1]); break; case 'browser-url': $this->_converter->setTestUrl($opt[1]); break; case 'remote-host': $this->_converter->setRemoteHost($opt[1]); break; case 'remote-port': $this->_converter->setRemotePort($opt[1]); break; case 'dest': $this->_destFolder = $opt[1]; break; case 'class-prefix': $this->_converter->setTplClassPrefix($opt[1]); break; case 'use-hash-postfix': $this->_useHashFilePostfix = true; break; case 'files-pattern': $this->_htmlPattern = $opt[1]; break; case 'output-tpl': $this->_tplFile = $opt[1]; break; case 'custom-param1': $this->_converter->setTplCustomParam1($opt[1]); break; case 'custom-param2': $this->_converter->setTplCustomParam2($opt[1]); break; case 'browsers': $this->_browsers = $opt[1]; $this->_converter->browsers = $this->_browsers; break; case 'project-build': $this->_projectBuild = $opt[1]; $this->_converter->_projectBuild = $this->_projectBuild; break; case 'project-name': $this->_projectName = $opt[1]; $this->_converter->_projectName = $this->_projectName; break; case 'screenshotsOnEveryStep': $this->_converter->screenshotsOnEveryStep = $opt[1]; break; case 'browserstackLocal': $this->_converter->browserstackLocal = $opt[1]; break; case 'browserstackLocalIdentifier': $this->_converter->browserstackLocalIdentifier = $opt[1]; break; case 'override-selenium-params': if (isset($opt[1])) { $this->_converter->overrideSeleniumParams = $opt[1]; } break; case 'single-test': if (isset($opt[1])) { $this->_converter->singleTest = true; } break; default: print "Unknown option \"{$opt[0]}\".\n"; exit(1); } } } } } if (is_array($flags)) { foreach ($flags as $flag) { switch ($flag) { case 'r': $this->_recursive = true; break; default: print "Unknown flag \"{$flag}\".\n"; exit(1); } } } }