public function testHasData() { $client = $this->getMockForAbstractClass('GuzzleHttp\\Command\\ServiceClientInterface'); $command = new Command('foo', []); $trans = new CommandTransaction($client, $command, ['foo' => 'bar']); $this->assertSame($client, $trans->getClient()); $this->assertSame($command, $trans->getCommand()); $this->assertSame('bar', $trans->getContext()->get('foo')); $this->assertNull($trans->getResult()); $this->assertNull($trans->getResponse()); $this->assertNull($trans->getRequest()); $this->assertNull($trans->getException()); }
/** * Get context associated with the command transfer. * * The return value is a Guzzle collection object which can be accessed and * mutated like a PHP associative array. You can add arbitrary data to the * context for application specific purposes. * * @return Collection */ public function getContext() { return $this->trans->getContext(); }