public function testSetGetIdentitySuccess() { $mockId = "0"; $client = new PredictionIOClient(); $client->identify($mockId); $this->assertSame($mockId, $client->getIdentity()); }
/** * Returns the recommendations for the given user according to the engine. * * @param $userId * @param $engine * @param int $count * @return mixed */ public function getRecommendations($userId, $engine, $count = 3) { $this->client->identify($userId); $command = $this->client->getCommand('itemrec_get_top_n', array('pio_engine' => $engine, 'pio_n' => $count)); $response = $this->client->execute($command); return $response['pio_iids']; }