public function testHasTransactionMethods() { $t = new puzzle_adapter_Transaction(new puzzle_Client(), new puzzle_message_Request('GET', '/')); $e = $this->getMockBuilder('puzzle_event_AbstractRequestEvent')->setConstructorArgs(array($t))->getMockForAbstractClass(); $this->assertSame($t->getClient(), $e->getClient()); $this->assertSame($t->getRequest(), $e->getRequest()); }
public function testHasRequestAndClient() { $c = new puzzle_Client(); $req = new puzzle_message_Request('GET', '/'); $response = new puzzle_message_Response(200); $t = new puzzle_adapter_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()); }