public function CurrencyTest::providerSource in Commerce Migrate 8.2
Same name in this branch
- 8.2 modules/ubercart/tests/src/Kernel/Plugin/migrate/source/CurrencyTest.php \Drupal\Tests\commerce_migrate_ubercart\Kernel\Plugin\migrate\source\CurrencyTest::providerSource()
- 8.2 modules/commerce/tests/src/Kernel/Plugin/migrate/source/commerce1/CurrencyTest.php \Drupal\Tests\commerce_migrate_commerce\Kernel\Plugin\migrate\source\commerce1\CurrencyTest::providerSource()
Same name and namespace in other branches
- 3.1.x modules/ubercart/tests/src/Kernel/Plugin/migrate/source/CurrencyTest.php \Drupal\Tests\commerce_migrate_ubercart\Kernel\Plugin\migrate\source\CurrencyTest::providerSource()
- 3.0.x modules/ubercart/tests/src/Kernel/Plugin/migrate/source/CurrencyTest.php \Drupal\Tests\commerce_migrate_ubercart\Kernel\Plugin\migrate\source\CurrencyTest::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
- modules/
ubercart/ tests/ src/ Kernel/ Plugin/ migrate/ source/ CurrencyTest.php, line 30
Class
- CurrencyTest
- Tests Ubercart currency source plugin.
Namespace
Drupal\Tests\commerce_migrate_ubercart\Kernel\Plugin\migrate\sourceCode
public function providerSource() {
$tests = [];
// The source data.
$tests[0]['source_data']['variable'] = [
[
'name' => 'uc_currency_code',
'value' => 's:3:"NZD";',
],
[
'name' => 'uc_currency_prec',
'value' => 's:1:"2";',
],
[
'name' => 'uc_currency_sign',
'value' => 's:1:"$";',
],
];
$tests[0]['expected_data'] = [
[
'uc_currency_code' => 'NZD',
'currency_name' => 'New Zealand Dollar',
'numeric_code' => '554',
],
];
$tests[0]['expected_count'] = NULL;
$tests[0]['configuration'] = [
'variables' => [
'uc_currency_code',
'uc_currency_prec',
'uc_currency_sign',
],
];
return $tests;
}