Beispiel #1
0
 public function testDetails()
 {
     $json = '{
       "account": "cperformance",
       "accountType": "GLOBAL",
       "capabilityFlags": [
         "CAN_SEND",
         "CAN_SIGN",
         "CAN_REPLACE_SIGNER"
       ],
       "channel": "_default",
       "company": "John Law Group",
       "email": "*****@*****.**",
       "firstName": "Bill",
       "initials": "NJ",
       "lastName": "John",
       "passwordExpiration": "2021-11-11T08:26:30-08:00"
     }';
     $transport = new \Echosign\Transports\GuzzleTransport();
     $client = $transport->getClient();
     $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->details('123456');
     $this->assertInstanceOf('Echosign\\Responses\\UserDetailsInfo', $response);
     $this->assertEquals('*****@*****.**', $response->getEmail());
     $capabilities = $response->getCapabilityFlags();
     $this->assertEquals(3, count($capabilities));
 }