SuggestedProductsTest.php in Commerce Migrate 3.1.x
File
modules/csv_example/tests/src/Unit/Plugin/migrate/process/SuggestedProductsTest.php
View source
<?php
namespace Drupal\Tests\commerce_migrate_csv_example\Unit\Plugin\migrate\process;
use Drupal\commerce_migrate_csv_example\Plugin\migrate\process\SuggestedProducts;
use Drupal\Tests\migrate\Unit\process\MigrateProcessTestCase;
class SuggestedProductsTest extends MigrateProcessTestCase {
public function testSuggestedProducts($value = NULL, $expected = NULL) {
$configuration = [];
$this->plugin = new SuggestedProducts($configuration, 'map', []);
$value = $this->plugin
->transform($value, $this->migrateExecutable, $this->row, 'foo');
$this
->assertSame($expected, $value);
}
public function providerTestSuggestedProducts() {
return [
'one' => [
[
'one',
'two',
],
[
[
'one',
],
[
'two',
],
],
],
];
}
}