public function NodewordsFieldTest::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/ Migrate/ d6/ NodewordsFieldTest.php, line 33
Class
- NodewordsFieldTest
- Tests Nodewords-D6 field source plugin.
Namespace
Drupal\Tests\metatag\Kernel\Migrate\d6Code
public function providerSource() {
return [
[
// Example source data for the test. This test is focused on making sure
// that Nodewords' integer values are converted to Metatag's strings.
[
'nodewords' => [
// This represents a node.
[
'type' => '5',
],
// This represents a taxonomy term.
[
'type' => '6',
],
// This represents a user.
[
'type' => '8',
],
],
],
// Expected results after going through the conversion process. After
// going through the initializeIterator() method, this is what the
// 'nodewords' value of the database's (faked) contents above should be
// turned into.
[
[
'entity_type' => 'node',
'type' => '5',
],
[
'entity_type' => 'taxonomy_term',
'type' => '6',
],
[
'entity_type' => 'user',
'type' => '8',
],
],
],
];
}