Commit aa565af2 authored by borisson_'s avatar borisson_

Revert "Expand count-widget unit test"

This reverts commit 91f37870.
parent a174d29c
...@@ -40,7 +40,6 @@ class CountWidgetOrderProcessorTest extends UnitTestCase { ...@@ -40,7 +40,6 @@ class CountWidgetOrderProcessorTest extends UnitTestCase {
new Result('llama', 'llama', 10), new Result('llama', 'llama', 10),
new Result('badger', 'badger', 5), new Result('badger', 'badger', 5),
new Result('duck', 'duck', 15), new Result('duck', 'duck', 15),
new Result('goose', 'goose', 15),
]; ];
$this->processor = new CountWidgetOrderProcessor([], 'count_widget_order', []); $this->processor = new CountWidgetOrderProcessor([], 'count_widget_order', []);
...@@ -50,6 +49,7 @@ class CountWidgetOrderProcessorTest extends UnitTestCase { ...@@ -50,6 +49,7 @@ class CountWidgetOrderProcessorTest extends UnitTestCase {
* Test sorting ascending. * Test sorting ascending.
*/ */
public function testAscending() { public function testAscending() {
$sorted_results = $this->processor->sortResults($this->original_results, 'ASC'); $sorted_results = $this->processor->sortResults($this->original_results, 'ASC');
$this->assertEquals(5, $sorted_results[0]->getCount()); $this->assertEquals(5, $sorted_results[0]->getCount());
...@@ -57,25 +57,22 @@ class CountWidgetOrderProcessorTest extends UnitTestCase { ...@@ -57,25 +57,22 @@ class CountWidgetOrderProcessorTest extends UnitTestCase {
$this->assertEquals(10, $sorted_results[1]->getCount()); $this->assertEquals(10, $sorted_results[1]->getCount());
$this->assertEquals('llama', $sorted_results[1]->getDisplayValue()); $this->assertEquals('llama', $sorted_results[1]->getDisplayValue());
$this->assertEquals(15, $sorted_results[2]->getCount()); $this->assertEquals(15, $sorted_results[2]->getCount());
$this->assertEquals('goose', $sorted_results[2]->getDisplayValue()); $this->assertEquals('duck', $sorted_results[2]->getDisplayValue());
$this->assertEquals(15, $sorted_results[3]->getCount());
$this->assertEquals('duck', $sorted_results[3]->getDisplayValue());
} }
/** /**
* Test sorting descending. * Test sorting descending.
*/ */
public function testDescending() { public function testDescending() {
$sorted_results = $this->processor->sortResults($this->original_results, 'DESC'); $sorted_results = $this->processor->sortResults($this->original_results, 'DESC');
$this->assertEquals(15, $sorted_results[0]->getCount()); $this->assertEquals(15, $sorted_results[0]->getCount());
$this->assertEquals('goose', $sorted_results[0]->getDisplayValue()); $this->assertEquals('duck', $sorted_results[0]->getDisplayValue());
$this->assertEquals(15, $sorted_results[1]->getCount()); $this->assertEquals(10, $sorted_results[1]->getCount());
$this->assertEquals('duck', $sorted_results[1]->getDisplayValue()); $this->assertEquals('llama', $sorted_results[1]->getDisplayValue());
$this->assertEquals(10, $sorted_results[2]->getCount()); $this->assertEquals(5, $sorted_results[2]->getCount());
$this->assertEquals('llama', $sorted_results[2]->getDisplayValue()); $this->assertEquals('badger', $sorted_results[2]->getDisplayValue());
$this->assertEquals(5, $sorted_results[3]->getCount());
$this->assertEquals('badger', $sorted_results[3]->getDisplayValue());
} }
} }
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