summaryrefslogtreecommitdiffstats
path: root/tests/src/Unit/Plugin
diff options
context:
space:
mode:
authorJoris Vercammen2015-11-11 21:36:39 (GMT)
committerJoris Vercammen2015-11-11 21:36:39 (GMT)
commit91f378704c240666765a99f61e181572027f2ff3 (patch)
tree818e14b4065070f71947daaea9beff12d4505737 /tests/src/Unit/Plugin
parente3aa92b0b44cd51bf8049245a826ec642aa740f5 (diff)
Expand count-widget unit test
Diffstat (limited to 'tests/src/Unit/Plugin')
-rw-r--r--tests/src/Unit/Plugin/processor/CountWidgetOrderProcessorTest.php19
1 files changed, 11 insertions, 8 deletions
diff --git a/tests/src/Unit/Plugin/processor/CountWidgetOrderProcessorTest.php b/tests/src/Unit/Plugin/processor/CountWidgetOrderProcessorTest.php
index a05d8bf..d501638 100644
--- a/tests/src/Unit/Plugin/processor/CountWidgetOrderProcessorTest.php
+++ b/tests/src/Unit/Plugin/processor/CountWidgetOrderProcessorTest.php
@@ -40,6 +40,7 @@ class CountWidgetOrderProcessorTest extends UnitTestCase {
new Result('llama', 'llama', 10),
new Result('badger', 'badger', 5),
new Result('duck', 'duck', 15),
+ new Result('goose', 'goose', 15),
];
$this->processor = new CountWidgetOrderProcessor([], 'count_widget_order', []);
@@ -49,7 +50,6 @@ class CountWidgetOrderProcessorTest extends UnitTestCase {
* Test sorting ascending.
*/
public function testAscending() {
-
$sorted_results = $this->processor->sortResults($this->original_results, 'ASC');
$this->assertEquals(5, $sorted_results[0]->getCount());
@@ -57,22 +57,25 @@ class CountWidgetOrderProcessorTest extends UnitTestCase {
$this->assertEquals(10, $sorted_results[1]->getCount());
$this->assertEquals('llama', $sorted_results[1]->getDisplayValue());
$this->assertEquals(15, $sorted_results[2]->getCount());
- $this->assertEquals('duck', $sorted_results[2]->getDisplayValue());
+ $this->assertEquals('goose', $sorted_results[2]->getDisplayValue());
+ $this->assertEquals(15, $sorted_results[3]->getCount());
+ $this->assertEquals('duck', $sorted_results[3]->getDisplayValue());
}
/**
* Test sorting descending.
*/
public function testDescending() {
-
$sorted_results = $this->processor->sortResults($this->original_results, 'DESC');
$this->assertEquals(15, $sorted_results[0]->getCount());
- $this->assertEquals('duck', $sorted_results[0]->getDisplayValue());
- $this->assertEquals(10, $sorted_results[1]->getCount());
- $this->assertEquals('llama', $sorted_results[1]->getDisplayValue());
- $this->assertEquals(5, $sorted_results[2]->getCount());
- $this->assertEquals('badger', $sorted_results[2]->getDisplayValue());
+ $this->assertEquals('goose', $sorted_results[0]->getDisplayValue());
+ $this->assertEquals(15, $sorted_results[1]->getCount());
+ $this->assertEquals('duck', $sorted_results[1]->getDisplayValue());
+ $this->assertEquals(10, $sorted_results[2]->getCount());
+ $this->assertEquals('llama', $sorted_results[2]->getDisplayValue());
+ $this->assertEquals(5, $sorted_results[3]->getCount());
+ $this->assertEquals('badger', $sorted_results[3]->getDisplayValue());
}
}