public function testWrongPhone() { $client = new NextCallerClient(null, null, true); try { $client->getByPhone('69255583865'); } catch (BadResponseException $expected) { $this->assertEquals(400, $expected->getResponse()->getStatusCode()); $this->assertEquals(555, $expected->getCode()); return; } $this->fail('An expected exception has not been raised.'); }
public function testGetByPhone() { $client = new NextCallerClient(null, null, true); $profiles = $client->getByPhone(self::PROFILE_PHONE); $this->assertEquals($profiles, json_decode(self::JSON_RESPONSE, true)); }
<?php require __DIR__ . '/vendor/autoload.php'; use NextCaller\NextCallerClient; $user = ""; $password = ""; $phoneNumber = "6925558386"; $sandbox = true; $client = new NextCallerClient($user, $password, $sandbox); try { $records = $client->getByPhone($phoneNumber); /* array( 'records' => array( array( 'id' => '68293d3f87db2c4ee97545add4bc67', 'first_name' => 'Dawn', 'middle_name' => 'E', 'last_name' => 'Brady', 'name' => 'Dawn E Brady', 'language' => 'English', 'phone' => array( array( 'number' => '6925558386', 'resource_uri' => '/v2/records/6925558386/' ) ), 'carrier' => 'Verizon Wireless', 'address' => array( array( 'city' => 'San Juan Capistrano',