public function TaxTypeTest::providerSource in Commerce Migrate 3.0.x
Same name in this branch
- 3.0.x modules/ubercart/tests/src/Kernel/Plugin/migrate/source/uc7/TaxTypeTest.php \Drupal\Tests\commerce_migrate_ubercart\Kernel\Plugin\migrate\source\uc7\TaxTypeTest::providerSource()
- 3.0.x modules/ubercart/tests/src/Kernel/Plugin/migrate/source/uc6/TaxTypeTest.php \Drupal\Tests\commerce_migrate_ubercart\Kernel\Plugin\migrate\source\uc6\TaxTypeTest::providerSource()
- 3.0.x modules/commerce/tests/src/Kernel/Plugin/migrate/source/commerce1/TaxTypeTest.php \Drupal\Tests\commerce_migrate_commerce\Kernel\Plugin\migrate\source\commerce1\TaxTypeTest::providerSource()
Same name and namespace in other branches
- 8.2 modules/ubercart/tests/src/Kernel/Plugin/migrate/source/uc7/TaxTypeTest.php \Drupal\Tests\commerce_migrate_ubercart\Kernel\Plugin\migrate\source\uc7\TaxTypeTest::providerSource()
- 3.1.x modules/ubercart/tests/src/Kernel/Plugin/migrate/source/uc7/TaxTypeTest.php \Drupal\Tests\commerce_migrate_ubercart\Kernel\Plugin\migrate\source\uc7\TaxTypeTest::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/ uc7/ TaxTypeTest.php, line 28
Class
- TaxTypeTest
- Tests Ubercart tax type source plugin.
Namespace
Drupal\Tests\commerce_migrate_ubercart\Kernel\Plugin\migrate\source\uc7Code
public function providerSource() {
$tests = [];
// The source data.
$tests[0]['source_data']['uc_taxes'] = [
[
'id' => '1',
'name' => 'Fee',
'rate' => '0.05',
'shippable' => '0',
'taxed_product_types' => 'a:2:{s:7:"product";s:7:"product";s:13:"entertainment";s:13:"entertainment";}',
'taxed_line_items' => 'a:0:{}',
'weight' => 0,
'display_include' => '0',
'inclusion_text' => '',
],
[
'id' => '2',
'name' => 'Handling',
'rate' => '0.44',
'shippable' => '0',
'taxed_product_types' => 'a:2:{s:7:"product";s:7:"product";s:13:"entertainment";s:13:"entertainment";}',
'taxed_line_items' => 'a:0:{}',
'weight' => 0,
'display_include' => '0',
'inclusion_text' => '',
],
];
$tests[0]['source_data']['variable'] = [
[
'name' => 'uc_store_country',
'value' => 's:3:"124";',
],
];
$tests[0]['source_data']['uc_countries'] = [
[
'country_id' => '124',
'country_name' => 'Canada',
'country_iso_code_2' => 'CA',
'country_iso_code_3' => 'CAN',
'version' => '2',
'weight' => '0',
],
[
'country_id' => '840',
'country_name' => 'United States',
'country_iso_code_2' => 'US',
'country_iso_code_3' => 'USA',
'version' => '1',
'weight' => '0',
],
];
$tests[0]['expected_data'] = [
[
'id' => '1',
'name' => 'Fee',
'rate' => '0.05',
'shippable' => '0',
'taxed_product_types' => unserialize('a:2:{s:7:"product";s:7:"product";s:13:"entertainment";s:13:"entertainment";}'),
'taxed_line_items' => unserialize('a:0:{}'),
'weight' => 0,
'country_iso_code_2' => 'CA',
'display_include' => '0',
'inclusion_text' => '',
],
[
'id' => '2',
'name' => 'Handling',
'rate' => '0.44',
'shippable' => '0',
'taxed_product_types' => unserialize('a:2:{s:7:"product";s:7:"product";s:13:"entertainment";s:13:"entertainment";}'),
'taxed_line_items' => unserialize('a:0:{}'),
'weight' => 0,
'country_iso_code_2' => 'CA',
'display_include' => '0',
'inclusion_text' => '',
],
];
return $tests;
}