/** * Identify API endpoint. * * @param array $params message to send to Segment * @return object Guzzle response object */ public static function identify(array $params) { $validate = new Validate(); $validate->identify($params); $message = $validate->addLibraryInfo($params); // Initialize Guzzle $client = new Client(['base_uri' => Segment::baseUrl(), 'timeout' => Segment::getTimeout(), 'auth' => [Segment::getApiKey(), ':']]); $apiConnection = new GuzzleRequest($client, 'identify/'); $identify = new ApiService($apiConnection); return $identify->send($message); }
/** * @expectedException \CdnSteve\Segment\ValidationException * @throws \CdnSteve\Segment\ValidationException */ public function testFailIdentifyNoUser() { $params = ['random123' => 'Bob Ross']; $validate = new Validate(); $validate->identify($params); }