/**
  * test removeSubcommand with an object.
  *
  * @return void
  */
 public function testRemoveSubcommand()
 {
     $parser = new ConsoleOptionParser('test', FALSE);
     $parser->addSubcommand(new ConsoleInputSubcommand('test'));
     $result = $parser->subcommands();
     $this->assertEquals(1, count($result));
     $parser->removeSubcommand('test');
     $result = $parser->subcommands();
     $this->assertEquals(0, count($result), 'Remove a subcommand does not work');
 }
Ejemplo n.º 2
0
 /**
  * test addSubcommand with an object.
  *
  * @return void
  */
 public function testAddSubcommandObject()
 {
     $parser = new ConsoleOptionParser('test', false);
     $parser->addSubcommand(new ConsoleInputSubcommand('test'));
     $result = $parser->subcommands();
     $this->assertEquals(1, count($result));
     $this->assertEquals('test', $result['test']->name());
 }