You are here

public function DisplayValueWidgetOrderProcessorTest::testSorting in Facets 8

Tests sorting.

File

tests/src/Unit/Plugin/processor/DisplayValueWidgetOrderProcessorTest.php, line 63

Class

DisplayValueWidgetOrderProcessorTest
Unit test for processor.

Namespace

Drupal\Tests\facets\Unit\Plugin\processor

Code

public function testSorting() {
  $result_count = $this->processor
    ->sortResults($this->originalResults[0], $this->originalResults[1]);
  $this
    ->assertEquals(-1, $result_count);
  $result_count = $this->processor
    ->sortResults($this->originalResults[1], $this->originalResults[2]);
  $this
    ->assertEquals(1, $result_count);
  $result_count = $this->processor
    ->sortResults($this->originalResults[2], $this->originalResults[3]);
  $this
    ->assertEquals(1, $result_count);
  $result_count = $this->processor
    ->sortResults($this->originalResults[3], $this->originalResults[4]);
  $this
    ->assertEquals(1, $result_count);
  $result_count = $this->processor
    ->sortResults($this->originalResults[4], $this->originalResults[5]);
  $this
    ->assertEquals(1, $result_count);
  $result_count = $this->processor
    ->sortResults($this->originalResults[5], $this->originalResults[6]);
  $this
    ->assertEquals(1, $result_count);
  $result_count = $this->processor
    ->sortResults($this->originalResults[6], $this->originalResults[5]);
  $this
    ->assertEquals(-1, $result_count);
  $result_count = $this->processor
    ->sortResults($this->originalResults[3], $this->originalResults[3]);
  $this
    ->assertEquals(0, $result_count);
}