You are here

public function SortsFieldTest::testGetActiveSort in Search API sorts 8

Tests with a sorts direction.

@dataProvider provideSortOrders

File

tests/src/Unit/SortsFieldTest.php, line 30

Class

SortsFieldTest
Tests the sorts field.

Namespace

Drupal\Tests\search_api_sorts\Unit

Code

public function testGetActiveSort($order_argument, $expected) {
  $field = new SortsField('monkey', $order_argument);
  $this
    ->assertEquals('monkey', $field
    ->getFieldName());
  $this
    ->assertEquals($expected, $field
    ->getOrder());
}