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

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