You are here

public function CommercePriceTest::providerTestInvalidType in Commerce Migrate 3.1.x

Same name in this branch
  1. 3.1.x modules/magento/tests/src/Unit/Plugin/migrate/process/CommercePriceTest.php \Drupal\Tests\commerce_migrate_magento\Unit\Plugin\migrate\process\CommercePriceTest::providerTestInvalidType()
  2. 3.1.x modules/csv_example/tests/src/Unit/Plugin/migrate/process/CommercePriceTest.php \Drupal\Tests\commerce_migrate_csv_example\Unit\Plugin\migrate\process\CommercePriceTest::providerTestInvalidType()
  3. 3.1.x modules/shopify/tests/src/Unit/Plugin/migrate/process/CommercePriceTest.php \Drupal\Tests\commerce_migrate_shopify\Unit\Plugin\migrate\process\CommercePriceTest::providerTestInvalidType()
Same name and namespace in other branches
  1. 8.2 modules/magento/tests/src/Unit/Plugin/migrate/process/CommercePriceTest.php \Drupal\Tests\commerce_migrate_magento\Unit\Plugin\migrate\process\CommercePriceTest::providerTestInvalidType()
  2. 3.0.x modules/magento/tests/src/Unit/Plugin/migrate/process/CommercePriceTest.php \Drupal\Tests\commerce_migrate_magento\Unit\Plugin\migrate\process\CommercePriceTest::providerTestInvalidType()

Data provider for testInvalidType().

File

modules/magento/tests/src/Unit/Plugin/migrate/process/CommercePriceTest.php, line 75

Class

CommercePriceTest
Tests the Commerce Price plugin.

Namespace

Drupal\Tests\commerce_migrate_magento\Unit\Plugin\migrate\process

Code

public function providerTestInvalidType() {
  $xml_str = <<<XML
<?xml version='1.0'?>
<mathematician>
 <name>Ada Lovelace</name>
</mathematician>
XML;
  $object = (object) [
    'one' => 'test1',
    'two' => 'test2',
    'three' => 'test3',
  ];
  return [
    'empty string' => [
      '',
    ],
    'string' => [
      'Extract Test',
    ],
    'integer' => [
      1,
    ],
    'float' => [
      1.0,
    ],
    'NULL' => [
      NULL,
    ],
    'boolean' => [
      TRUE,
    ],
    'xml' => [
      $xml_str,
    ],
    'object' => [
      $object,
    ],
  ];
}