You are here

public function ViewModeTest::getDefaultViewModeTestDataProvider in Search API Pages 8

Data provider for the getDefaultViewMode tests.

Return value

array The test data.

File

tests/src/Unit/ViewModeTest.php, line 114

Class

ViewModeTest
Class ViewModeTest.

Namespace

Drupal\Tests\search_api_page\Unit

Code

public function getDefaultViewModeTestDataProvider() {
  $testData = [];
  $testData['No configuration defaults to the global default'] = [
    'input' => [],
    'dataSourceId' => 'entity:node',
    'expected' => ViewMode::DEFAULT_VIEW_MODE,
  ];
  $testData['Unknown data source defaults to the global default'] = [
    'input' => [
      'entity:taxonomy_term' => [
        'default' => 'full',
      ],
    ],
    'dataSourceId' => 'entity:node',
    'expected' => ViewMode::DEFAULT_VIEW_MODE,
  ];
  $testData['Empty default defaults to the global default'] = [
    'input' => [
      'entity:node' => [
        'default' => '',
      ],
    ],
    'dataSourceId' => 'entity:node',
    'expected' => ViewMode::DEFAULT_VIEW_MODE,
  ];
  $testData['Gets the configured default'] = [
    'input' => [
      'entity:node' => [
        'default' => 'full',
      ],
    ],
    'dataSourceId' => 'entity:node',
    'expected' => 'full',
  ];
  return $testData;
}