コード例 #1
0
 public function testAccessMethods()
 {
     $getopt = new Getopt('a');
     $getopt->parse('-a foo');
     $options = $getopt->getOptions();
     $this->assertCount(1, $options);
     $this->assertEquals('1', $options['a']);
     $this->assertEquals('1', $getopt->getOption('a'));
     $operands = $getopt->getOperands();
     $this->assertCount(1, $operands);
     $this->assertEquals('foo', $operands[0]);
     $this->assertEquals('foo', $getopt->getOperand(0));
 }