Esempio n. 1
0
 /**
  * Data provider for test testSettingQueryParams()
  *
  * @return array
  */
 public function getTestSettingQueryParamsData()
 {
     $cases = [];
     $search = new Search();
     $search->setSearchType('dfs_query_then_fetch');
     $cases['Only search_type is set'] = [$search, ['search_type' => 'dfs_query_then_fetch']];
     $search = new Search();
     $search->setRequestCache(true);
     $cases['Only request_cache is set'] = [$search, ['request_cache' => true]];
     $search = new Search();
     $search->setScroll('1m');
     $cases['Only scroll is set'] = [$search, ['scroll' => '1m']];
     $search = new Search();
     $search->setPreference('_local');
     $cases['Only preference is set'] = [$search, ['preference' => '_local']];
     $search = new Search();
     $search->setSearchType('dfs_query_then_fetch');
     $search->setRequestCache(true);
     $search->setScroll('1m');
     $search->setPreference('_local');
     $cases['Multiple parameters are set'] = [$search, ['search_type' => 'dfs_query_then_fetch', 'request_cache' => true, 'scroll' => '1m', 'preference' => '_local']];
     return $cases;
 }