/**
  * @covers Guzzle\Service\Description\ServiceDescription
  * @covers Guzzle\Service\Description\ServiceDescription::__construct
  * @covers Guzzle\Service\Description\ServiceDescription::getCommands
  * @covers Guzzle\Service\Description\ServiceDescription::getCommand
  */
 public function testConstructor()
 {
     $service = new ServiceDescription($this->serviceData);
     $this->assertEquals(1, count($service->getCommands()));
     $this->assertFalse($service->hasCommand('foobar'));
     $this->assertTrue($service->hasCommand('test_command'));
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 public function factory($name, array $args = array())
 {
     if ($this->description->hasCommand($name)) {
         $command = $this->description->getCommand($name);
         $class = $command->getConcreteClass();
         return new $class($args, $command);
     }
 }