Code Duplication    Length = 10-11 lines in 2 locations

tests/SearchAndIndexingTest.php 1 location

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

tests/SearchableTest.php 1 location

@@ 775-785 (lines=11) @@
772
	}
773
774
775
	private function getResultsFor($query, $pageLength = 10) {
776
		$es = new ElasticSearcher();
777
		$es->setStart(0);
778
		$es->setPageLength($pageLength);
779
		//$es->addFilter('IsInSiteTree', false);
780
		$es->setClasses('FlickrPhotoTO');
781
		$fields = array('Title' => 1, 'Description' => 1);
782
		$resultList = $es->search($query, $fields)->getList();
783
		$this->assertEquals('SilverStripe\Elastica\ResultList', get_class($resultList));
784
		return $resultList;
785
	}
786
787
}
788