public function ContactSettingsTest::providerSource in Drupal 10
Same name and namespace in other branches
- 8 core/modules/contact/tests/src/Kernel/Plugin/migrate/source/d6/ContactSettingsTest.php \Drupal\Tests\contact\Kernel\Plugin\migrate\source\d6\ContactSettingsTest::providerSource()
- 9 core/modules/contact/tests/src/Kernel/Plugin/migrate/source/d6/ContactSettingsTest.php \Drupal\Tests\contact\Kernel\Plugin\migrate\source\d6\ContactSettingsTest::providerSource()
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
- core/modules/ contact/ tests/ src/ Kernel/ Plugin/ migrate/ source/ d6/ ContactSettingsTest.php, line 23 
Class
- ContactSettingsTest
- Tests D6 contact settings source plugin.
Namespace
Drupal\Tests\contact\Kernel\Plugin\migrate\source\d6Code
public function providerSource() {
  $tests = [];
  $tests[0]['source_data']['variable'] = [
    [
      'name' => 'site_name',
      'value' => serialize('foo!'),
    ],
  ];
  $tests[0]['source_data']['contact'] = [
    [
      'cid' => '1',
      'category' => 'Website feedback',
      'recipients' => 'admin@example.com',
      'reply' => '',
      'weight' => '0',
      'selected' => '1',
    ],
  ];
  $tests[0]['expected_data'] = [
    [
      'default_category' => '1',
      'site_name' => 'foo!',
    ],
  ];
  $tests[0]['expected_count'] = NULL;
  $tests[0]['configuration']['variables'] = [
    'site_name',
  ];
  return $tests;
}