Пример #1
0
 public function testCanGetCount()
 {
     $api = new AdvancedSearch(getenv('ADVANCED_SEARCH_API_KEY'));
     if (!getenv('ADVANCED_SEARCH_API_KEY')) {
         $this->mockGuzzle($api->getHttpClient(), [$this->getMockJsonResponse('search-count.json')]);
     }
     $count = $api->count('london');
     $this->assertGreaterThan(0, $count);
 }
 public function testCanDoAdvancedKeywordSearch()
 {
     $api = new AdvancedSearch(getenv('ADVANCED_SEARCH_API_KEY'));
     if (!getenv('ADVANCED_SEARCH_API_KEY')) {
         $this->mockGuzzle($api->getHttpClient(), [$this->getMockJsonResponse('search.json')]);
     }
     $result = $api->search('london');
     $this->assertEquals(10, count($result->hits));
 }