예제 #1
0
 /**
  * @covers Opl_Getopt_Option::setMinOccurences
  * @covers Opl_Getopt_Option::getMinOccurences
  */
 public function testMaxOccurencesSetting()
 {
     $option = new Opl_Getopt_Option('foo', 'x');
     $option->setMaxOccurences(5);
     $this->assertEquals(5, $option->getMaxOccurences());
 }
예제 #2
0
 /**
  * @covers Opl_Getopt::__construct
  * @covers Opl_Getopt::parse
  */
 public function testShortAttributeUsedTwiceWithIncrementation2()
 {
     $getopt = new Opl_Getopt(Opl_Getopt::ALLOW_INCREMENTING);
     $getopt->addOption($option = new Opl_Getopt_Option('a', 'a'));
     $option->setMaxOccurences(2);
     $this->assertTrue($getopt->parse(array('-aa')));
     $this->assertEquals(2, $option->getOccurences());
 }