Beispiel #1
0
 /**
  * parse the argv data and build values
  *
  * @param array  $argv  An optional array of argv values used for testing.  Leave blank to use the default $_SERVER['argv']
  *
  * @return ArgumentValues An array-like object that contains switches and data
  */
 public function getOptsValues($argv = null)
 {
     $parsed_args = ArgumentsParser::parseArgvWithSpec($this->resolveArgv($argv), $this->arguments_spec);
     return new ArgumentValues($this->arguments_spec, $parsed_args);
 }
 protected function verifyParsedArgs($text_spec, $fake_argv, $expected_result)
 {
     $arguments_spec = TextSpecParser::createArgumentsSpec($text_spec);
     $parsed_args = ArgumentsParser::parseArgvWithSpec($fake_argv, $arguments_spec);
     $this->assertEquals($expected_result, $parsed_args);
 }