function ContactSettingsTest::providerSource

Same name and namespace in other branches
  1. 8.9.x core/modules/contact/tests/src/Kernel/Plugin/migrate/source/d6/ContactSettingsTest.php \Drupal\Tests\contact\Kernel\Plugin\migrate\source\d6\ContactSettingsTest::providerSource()
  2. 10 core/modules/contact/tests/src/Kernel/Plugin/migrate/source/d6/ContactSettingsTest.php \Drupal\Tests\contact\Kernel\Plugin\migrate\source\d6\ContactSettingsTest::providerSource()
  3. 11.x 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

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\d6

Code

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.