You are here

public function NodewordsFieldInstanceTest::providerSource in Metatag 8

The data provider.

Return value

array Array of data sets to test, each of which is a numerically indexed array with the following elements:

  • An array of source data, which can be optionally processed and set up by subclasses.
  • An array of expected result rows.
  • (optional) The number of result rows the plugin under test is expected to return. If this is not a numeric value, the plugin will not be counted.
  • (optional) Array of configuration options for the plugin under test.

Overrides MigrateSourceTestBase::providerSource

See also

\Drupal\Tests\migrate\Kernel\MigrateSourceTestBase::testSource

File

tests/src/Kernel/Plugin/migrate/source/d6/NodewordsFieldInstanceTest.php, line 77

Class

NodewordsFieldInstanceTest
Tests Metatag-D6 field instance source plugin.

Namespace

Drupal\Tests\metatag\Kernel\Plugin\migrate\source\d6

Code

public function providerSource() {
  $tests[0]['source_data']['nodewords'] = [
    [
      'type' => 5,
    ],
    [
      'type' => 6,
    ],
    [
      'type' => 8,
    ],
  ];
  $tests[0]['expected_data'] = [
    [
      'entity_type' => 'node',
      'type' => 5,
      'bundle' => 'first_content_type',
    ],
    [
      'entity_type' => 'node',
      'type' => 5,
      'bundle' => 'second_content_type',
    ],
    [
      'entity_type' => 'taxonomy_term',
      'type' => 6,
      'bundle' => 'test_vocabulary',
    ],
    [
      'entity_type' => 'user',
      'type' => 8,
      'bundle' => 'user',
    ],
  ];
  return $tests;
}