public function testHasTransactionMethods() { $t = new Transaction(new Client(), new Request('GET', '/')); $e = $this->getMockBuilder('GuzzleHttp\\Event\\AbstractRequestEvent')->setConstructorArgs([$t])->getMockForAbstractClass(); $this->assertSame($t->getClient(), $e->getClient()); $this->assertSame($t->getRequest(), $e->getRequest()); }
public function testHasRequestAndClient() { $c = new Client(); $req = new Request('GET', '/'); $response = new Response(200); $t = new Transaction($c, $req); $this->assertSame($c, $t->getClient()); $this->assertSame($req, $t->getRequest()); $this->assertNull($t->getResponse()); $t->setResponse($response); $this->assertSame($response, $t->getResponse()); }