Пример #1
0
 /**
  * @group GH-377
  */
 public function testEmptyRequiredOption()
 {
     $opts = new Zend_Console_Getopt(array('apple|a=s' => "First required argument", 'banana|b=i' => "Second required argument"));
     $opts->addArguments(array("-a", "-b", "123"));
     try {
         $opts->parse();
         $opts->checkRequiredArguments();
         $this->fail('Expected to catch a Zend_Console_Getopt_Exception');
     } catch (Zend_Exception $e) {
         $this->assertTrue($e instanceof Zend_Console_Getopt_Exception, 'Expected Zend_Console_Getopt_Exception, got ' . get_class($e));
         $this->assertEquals('Option "a" requires a parameter.', $e->getMessage());
     }
 }