You are here

public function ProductProcessorTest::setUp in Commerce Feeds 8

Overrides CommerceFeedsKernelTestBase::setUp

File

tests/src/Kernel/Processor/ProductProcessorTest.php, line 27

Class

ProductProcessorTest
@coversDefaultClass \Drupal\commerce_feeds\Feeds\Processor\ProductProcessor @group commerce_feeds

Namespace

Drupal\Tests\commerce_feeds\Kernel\Processor

Code

public function setUp() {
  parent::setUp();

  // Create feed type.
  $this->feedType = $this
    ->createFeedTypeForCsv([
    'guid' => 'guid',
    'title' => 'title',
    'sku' => 'sku',
    'store' => 'store',
  ], [
    'processor' => 'entity:commerce_product',
    'processor_configuration' => [
      'authorize' => FALSE,
      'values' => [
        'type' => 'default',
      ],
    ],
    'mappings' => array_merge($this
      ->getDefaultMappings(), [
      [
        'target' => 'variations',
        'map' => [
          'target_id' => 'sku',
        ],
        'settings' => [
          'reference_by' => 'sku',
        ],
      ],
    ]),
  ]);
}