You are here

public function TermWeightWidgetOrderProcessorTest::testLow in Facets 8

Compare a term with a low weight with a term with a high.

File

tests/src/Unit/Plugin/processor/TermWeightWidgetOrderProcessorTest.php, line 152

Class

TermWeightWidgetOrderProcessorTest
Unit test for processor.

Namespace

Drupal\Tests\facets\Unit\Plugin\processor

Code

public function testLow() {
  $this->termA
    ->expects($this
    ->any())
    ->method('getWeight')
    ->willReturn('-10');
  $this->termB
    ->expects($this
    ->any())
    ->method('getWeight')
    ->willReturn('10');

  // Compare the two values and check the result with an assertion.
  $sort_value = $this->processor
    ->sortResults($this->originalResults[0], $this->originalResults[1]);
  $this
    ->assertLessThan(0, $sort_value);
}