Code Duplication    Length = 10-11 lines in 2 locations

tests/SearchableTest.php 1 location

@@ 808-818 (lines=11) @@
805
	}
806
807
808
	private function getResultsFor($query, $pageLength = 10) {
809
		$es = new ElasticSearcher();
810
		$es->setStart(0);
811
		$es->setPageLength($pageLength);
812
		//$es->addFilter('IsInSiteTree', false);
813
		$es->setClasses('FlickrPhotoTO');
814
		$fields = array('Title' => 1, 'Description' => 1);
815
		$resultList = $es->search($query, $fields)->getList();
816
		$this->assertEquals('SilverStripe\Elastica\ResultList', get_class($resultList));
817
		return $resultList;
818
	}
819
820
}
821

tests/SearchAndIndexingTest.php 1 location

@@ 442-451 (lines=10) @@
439
	}
440
441
442
	private function getResultsFor($query, $pageLength = 10, $fields = array('Title' => 1, 'Description' => 1)) {
443
		$es = new ElasticSearcher();
444
		$es->setStart(0);
445
		$es->setPageLength($pageLength);
446
		$es->setClasses('FlickrPhotoTO');
447
		$resultList = $es->search($query, $fields)->getList();
448
		$this->assertEquals('SilverStripe\Elastica\ResultList', get_class($resultList));
449
		return $resultList;
450
	}
451
452
453
}
454