Example #1
0
 public function testHasOnCompleteMethod()
 {
     $that = $this;
     $called = 0;
     $testFunction = function ($command) use(&$called, $that) {
         $called++;
         $that->assertInstanceOf('Guzzle\\Service\\Command\\CommandInterface', $command);
     };
     $client = $this->getClient();
     $command = new MockCommand(array('command.on_complete' => $testFunction), $this->getOperation());
     $command->setClient($client);
     $command->prepare()->setResponse(new Response(200), true);
     $command->execute();
     $this->assertEquals(1, $called);
 }
 /**
  * @covers Guzzle\Service\Command\AbstractCommand::execute
  * @expectedException RuntimeException
  */
 public function testExecuteThrowsExceptionWhenNoClientIsSet()
 {
     $command = new MockCommand();
     $command->execute();
 }