You are here

public function SupportedGroupingFieldsTest::testGetGroupingFields in Search API Grouping 8

Test the return of the grouping fields.

File

tests/src/Unit/SupportedGroupingFieldsTest.php, line 107

Class

SupportedGroupingFieldsTest
Test the getSupportedFields method.

Namespace

Drupal\Tests\search_api_grouping\Unit

Code

public function testGetGroupingFields() {
  $config = [
    'grouping_fields' => [
      'type' => 'type',
      'uid' => 'uid',
      'author' => 0,
    ],
  ];
  $this->processor
    ->setConfiguration($config);
  $fields = $this->processor
    ->getGroupingFields();
  $this
    ->assertEquals('type', $fields['type']);
  $this
    ->assertEquals('uid', $fields['uid']);
  $this
    ->assertArrayNotHasKey('author', $fields);
}