public function testDocuments() { $returnJson = '{ "documents": [ { "documentId": "2AAABLblqZhBEsJow3IswASHPCt74o33MTcMKvaqnH1sbZEyh18WYqB8DoKkUrlemBsVyIhuSOhI*", "mimeType": "application/pdf", "name": "May 5.pdf" } ] }'; $transport = new \Echosign\Transports\GuzzleTransport(); $client = $transport->getClient(); $stream = Stream::factory($returnJson); $mock = new Mock([new Response(200, ['content-type' => 'application/json'], $stream)]); $client->getEmitter()->attach($mock); $agreement = new Agreements('12335', $transport); $response = $agreement->documents('12345'); $this->assertInstanceOf('Echosign\\Responses\\AgreementDocuments', $response); $documents = $response->getDocuments(); $this->assertEquals(1, count($documents)); $this->assertEquals("application/pdf", $documents[0]['mimeType']); }