/** * Test to array. * * @param Search $options * @param array $expected * * @dataProvider optionsProvider */ public function testToArray(Search $options, array $expected) { $actual = $options->toArray(); ksort($actual); ksort($expected); $this->assertEquals($actual, $expected); }
/** * Search venues. * * @param Search $options The search options. * * @return Venue[] */ public function search(Search $options) { $url = $this->getUrl('venues/search', $options->toArray()); $response = $this->httpClient->get($url, $this->getDefaultHeaders()); $description = $this->parseResponse($response); if (!isset($description->response->venues)) { throw InvalidResponseException::invalidResponseBody($response, 'response.venues'); } return array_map(function (\stdClass $venueDescription) { return $this->venueFactory->create($venueDescription); }, $description->response->venues); }