Ejemplo n.º 1
0
 public function testListAll()
 {
     $transport = new \Echosign\Transports\GuzzleTransport();
     $client = $transport->getClient();
     $json = '{
       "userInfoList": [
         {
           "company": "My Company, LLC",
           "email": "*****@*****.**",
           "fullNameOrEmail": "My Company",
           "groupId": "2BAABLblqZhAxtQfJjDmP2rfRiL_sT83WVNLSS_ZrcOw6UQNbfYYZn9HSluHuA1x63UT41eFNAYI*",
           "userId": "2ACABLblqZhAKeyuN406fXRj1LowesdnhuXS_c8mxjpby3X9p-NXY_NWXq4RAoMKWqVtElqjA5gk*"
         }
       ]
     }';
     $stream = Stream::factory($json);
     $mock = new Mock([new Response(200, ['content-type' => 'application/json'], $stream)]);
     $client->getEmitter()->attach($mock);
     $users = new Users('465789', $transport);
     $response = $users->listAll();
     $this->assertInstanceOf('Echosign\\Responses\\UsersInfo', $response);
     $usersInfo = $response->getUserInfoList();
     $this->assertEquals(1, count($usersInfo));
     $this->assertEquals('*****@*****.**', $usersInfo[0]['email']);
 }