public function ThemeSettingsTest::providerSource in Drupal 9
Same name and namespace in other branches
- 8 core/modules/system/tests/src/Kernel/Plugin/migrate/source/d7/ThemeSettingsTest.php \Drupal\Tests\system\Kernel\Plugin\migrate\source\d7\ThemeSettingsTest::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/ system/ tests/ src/ Kernel/ Plugin/ migrate/ source/ d7/ ThemeSettingsTest.php, line 24
Class
- ThemeSettingsTest
- Tests D7 theme settings source plugin.
Namespace
Drupal\Tests\system\Kernel\Plugin\migrate\source\d7Code
public function providerSource() {
$tests = [];
// The source data.
$value = [
'toggle_logo' => 1,
'toggle_name' => 1,
'toggle_slogan' => 1,
'toggle_node_user_picture' => 1,
'toggle_comment_user_picture' => 1,
'toggle_comment_user_verification' => 1,
'toggle_favicon' => 1,
'toggle_main_menu' => 1,
'toggle_secondary_menu' => 1,
'default_logo' => 1,
'logo_path' => ' ',
'logo_upload' => ' ',
'default_favicon' => 1,
'favicon_path' => ' ',
'favicon_upload' => ' ',
'scheme' => 'firehouse',
];
$tests[0]['source_data']['variable'] = [
[
'name' => 'theme_bartik_settings',
'value' => serialize($value),
],
];
// The expected results are nearly identical to the source data.
$tests[0]['expected_data'] = [
[
'name' => 'theme_bartik_settings',
'value' => $value,
],
];
return $tests;
}