Commit ca9242c9 authored by borisson_'s avatar borisson_

Expand MinimumCountProcessorTest

parent e94e71ef
......@@ -46,6 +46,50 @@ class MinimumCountProcessorTest extends UnitTestCase {
$this->processor = new MinimumCountProcessor([], 'minimum_count', []);
}
/**
* Test no filtering happens
*/
public function testNoFilter() {
$facet = new Facet([], 'facet');
$facet->setResults($this->original_results);
$facet->setProcessorConfigs([
'minimum_count' => [
'settings' => ['minimum_items' => 4]
]
]);
$sorted_results = $this->processor->build($facet, $this->original_results);
$this->assertCount(3, $sorted_results);
$this->assertEquals('llama', $sorted_results[0]->getDisplayValue());
$this->assertEquals('badger', $sorted_results[1]->getDisplayValue());
$this->assertEquals('duck', $sorted_results[2]->getDisplayValue());
}
/**
* Test no filtering happens
*/
public function testMinEqualsValue() {
$facet = new Facet([], 'facet');
$facet->setResults($this->original_results);
$facet->setProcessorConfigs([
'minimum_count' => [
'settings' => ['minimum_items' => 5]
]
]);
$sorted_results = $this->processor->build($facet, $this->original_results);
$this->assertCount(3, $sorted_results);
$this->assertEquals('llama', $sorted_results[0]->getDisplayValue());
$this->assertEquals('badger', $sorted_results[1]->getDisplayValue());
$this->assertEquals('duck', $sorted_results[2]->getDisplayValue());
}
/**
* Test filtering of results
*/
......@@ -55,7 +99,7 @@ class MinimumCountProcessorTest extends UnitTestCase {
$facet->setResults($this->original_results);
$facet->setProcessorConfigs([
'minimum_count' => [
'settings' => ['minimum_items' => 6]
'settings' => ['minimum_items' => 8]
]
]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment