You are here

public function ViewModeTest::isOverriddenTestDataProvider in Search API Pages 8

Data provider for the isOverridden tests.

Return value

array The test data.

File

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

Class

ViewModeTest
Class ViewModeTest.

Namespace

Drupal\Tests\search_api_page\Unit

Code

public function isOverriddenTestDataProvider() {
  $testData = [];
  $testData['No configuration'] = [
    'input' => [],
    'dataSourceId' => 'entity:node',
    'bundle' => 'article',
    'expected' => FALSE,
  ];
  $testData['Unknown data source'] = [
    'input' => [
      'entity:taxonomy_term' => [
        'overrides' => [
          'tags' => 'full',
        ],
      ],
    ],
    'dataSourceId' => 'entity:node',
    'bundle' => 'article',
    'expected' => FALSE,
  ];
  $testData['No overrides configured'] = [
    'input' => [
      'entity:node' => [
        'overrides' => [],
      ],
    ],
    'dataSourceId' => 'entity:node',
    'bundle' => 'article',
    'expected' => FALSE,
  ];
  $testData['No overrides'] = [
    'input' => [
      'entity:node' => [
        'overrides' => [
          'article' => '',
          'page' => '',
        ],
      ],
    ],
    'dataSourceId' => 'entity:node',
    'bundle' => 'article',
    'expected' => FALSE,
  ];
  $testData['Different bundle overridden'] = [
    'input' => [
      'entity:node' => [
        'overrides' => [
          'article' => '',
          'page' => 'full',
        ],
      ],
    ],
    'dataSourceId' => 'entity:node',
    'bundle' => 'article',
    'expected' => FALSE,
  ];
  $testData['Override present'] = [
    'input' => [
      'entity:node' => [
        'overrides' => [
          'article' => 'full',
          'page' => '',
        ],
      ],
    ],
    'dataSourceId' => 'entity:node',
    'bundle' => 'article',
    'expected' => TRUE,
  ];
  return $testData;
}