/** * @param string $job_id * * @return array * * @throws \Exception */ private function getJobResult($account_id, $job_id) { $account_id = $this->fixAccountId($account_id); $data = array('report_run_id' => $job_id, 'limit' => 5000); $result = $this->core->curl($data, '/' . $account_id . '/reportstats', 'get'); if (!isset($result->data)) { throw new \Exception('something went wrong :('); } return $result->data; }
public function testPagination() { $friendlists = $this->core->fql('select count, flid from friendlist where owner = me()'); usort($friendlists, function ($a, $b) { if ($a->count == $b->count) { return 0; } return $a->count > $b->count ? -1 : 1; }); $list = reset($friendlists); $page_size = ceil($list->count / 5); $test_result = $this->core->curl(array('limit' => $page_size), '/' . $list->flid . '/members', 'get'); /** @noinspection PhpUndefinedFieldInspection */ $this->assertCount($list->count, $test_result->data); }