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'));
 }
Exemple #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'));
 }
Exemple #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'));
 }