예제 #1
0
 public function testValidatorUpdatesDefaultValues()
 {
     $command = new MockCommand();
     $command->setClient(new \Guzzle\Service\Client());
     $command->prepare();
     $this->assertEquals(123, $command->get('test'));
     $this->assertEquals('abc', $command->get('_internal'));
 }
예제 #2
0
 /**
  * @covers Guzzle\Service\Command\AbstractCommand
  */
 public function testCommandsUsesApiCommand()
 {
     $api = $this->getApiCommand();
     $command = new MockCommand(array(), $api);
     $this->assertSame($api, $command->getApiCommand());
     $command->setClient($this->getClient())->prepare();
     $this->assertEquals('123', $command->get('test'));
     $this->assertSame($api, $command->getApiCommand($api));
 }
 /**
  * @covers Guzzle\Service\Command\AbstractCommand::__call
  */
 public function testMissingMethodCallsAllowedWhenEnabled()
 {
     $command = new MockCommand(array('command.magic_method_call' => true), $this->getApiCommand());
     $command->setTest('foo');
     $this->assertEquals('foo', $command->get('test'));
 }
예제 #4
0
 public function testValidatorUpdatesCommand()
 {
     $command = new MockCommand(array('test' => 123, 'foo' => 'bar'));
     $command->setClient(new \Guzzle\Service\Client());
     $command->prepare();
     $this->assertEquals(123, $command->get('test'));
     $this->assertEquals('abc', $command->get('_internal'));
     $this->assertEquals('BAR', $command->get('foo'));
 }