コード例 #1
0
 /**
  * Test to array.
  *
  * @param Trending $options
  * @param array $expected
  *
  * @dataProvider  optionsProvider
  */
 public function testToArray(Trending $options, array $expected)
 {
     $actual = $options->toArray();
     ksort($actual);
     ksort($expected);
     $this->assertEquals($actual, $expected);
 }
コード例 #2
0
 /**
  * Get trending venues.
  *
  * @param Trending $options The trending options.
  *
  * @return Venue[]
  */
 public function trending(Trending $options)
 {
     $url = $this->getUrl('venues/trending', $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);
 }