Code Duplication    Length = 10-11 lines in 2 locations

tests/SearchAndIndexingTest.php 1 location

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

tests/SearchableTest.php 1 location

@@ 762-772 (lines=11) @@
759
	}
760
761
762
	private function getResultsFor($query, $pageLength = 10) {
763
		$es = new ElasticSearcher();
764
		$es->setStart(0);
765
		$es->setPageLength($pageLength);
766
		$es->setClasses('FlickrPhotoTO');
767
		$fields = array('Title' => 1, 'Description' => 1);
768
		$resultList = $es->search($query, $fields)->getList();
769
		$this->assertEquals('SilverStripe\Elastica\ResultList', get_class($resultList));
770
		return $resultList;
771
	}
772
773
}
774