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

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