예제 #1
0
 /**
  * @dataProvider provideSearch
  * @covers SearchEngine::defaultPrefixSearch
  */
 public function testSearchWithOffset(array $case)
 {
     $this->search->setLimitOffset(3, 1);
     $results = $this->search->defaultPrefixSearch($case['query']);
     $results = array_map(function (Title $t) {
         return $t->getPrefixedText();
     }, $results);
     // We don't expect the first result when offsetting
     array_shift($case['results']);
     // And sometimes we expect a different last result
     $expected = isset($case['offsetresult']) ? array_merge($case['results'], $case['offsetresult']) : $case['results'];
     $this->assertEquals($expected, $results, $case[0]);
 }