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

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