/**
  * @covers Guzzle\Service\Description\ApiCommand::__construct
  */
 public function testAllowsConcreteCommands()
 {
     $c = new ApiCommand(array('name' => 'test', 'class' => 'Guzzle\\Service\\Command\\ClosureCommand', 'params' => array('p' => new ApiParam(array('name' => 'foo')))));
     $this->assertEquals('Guzzle\\Service\\Command\\ClosureCommand', $c->getConcreteClass());
 }
Ejemplo n.º 2
0
 /**
  * @covers Guzzle\Service\Description\ApiCommand
  */
 public function testCanBuildUpCommands()
 {
     $c = new ApiCommand(array());
     $c->setName('foo')->setConcreteClass('Baz')->setDeprecated(false)->setDoc('doc')->setDocUrl('http://www.foo.com')->setMethod('PUT')->setResultDoc('oh')->setResultType('string')->setUri('/foo/bar')->addParam(new ApiParam(array('name' => 'test')));
     $this->assertEquals('foo', $c->getName());
     $this->assertEquals('Baz', $c->getConcreteClass());
     $this->assertEquals(false, $c->isDeprecated());
     $this->assertEquals('doc', $c->getDoc());
     $this->assertEquals('http://www.foo.com', $c->getDocUrl());
     $this->assertEquals('PUT', $c->getMethod());
     $this->assertEquals('oh', $c->getResultDoc());
     $this->assertEquals('string', $c->getResultType());
     $this->assertEquals('/foo/bar', $c->getUri());
     $this->assertEquals(array('test'), $c->getParamNames());
 }