You are here

public function ImageTest::testFileMigration in Commerce Migrate 8.2

Same name in this branch
  1. 8.2 modules/csv_example/tests/src/Kernel/Migrate/ImageTest.php \Drupal\Tests\commerce_migrate_csv_example\Kernel\Migrate\ImageTest::testFileMigration()
  2. 8.2 modules/magento/tests/src/Kernel/Migrate/magento2/ImageTest.php \Drupal\Tests\commerce_migrate_magento\Kernel\Migrate\magento2\ImageTest::testFileMigration()
Same name and namespace in other branches
  1. 3.1.x modules/csv_example/tests/src/Kernel/Migrate/ImageTest.php \Drupal\Tests\commerce_migrate_csv_example\Kernel\Migrate\ImageTest::testFileMigration()
  2. 3.0.x modules/csv_example/tests/src/Kernel/Migrate/ImageTest.php \Drupal\Tests\commerce_migrate_csv_example\Kernel\Migrate\ImageTest::testFileMigration()

Tests image file migration from CSV source file.

File

modules/csv_example/tests/src/Kernel/Migrate/ImageTest.php, line 90

Class

ImageTest
Tests Product migration.

Namespace

Drupal\Tests\commerce_migrate_csv_example\Kernel\Migrate

Code

public function testFileMigration() {
  $this
    ->assertEntity(1, 'TherMaxx 3mm - Black - Mens - XS.jpeg', 'public://import/images/TherMaxx%203mm%20-%20Black%20-%20Mens%20-%20XS.jpeg', 'image/jpeg', '4789', '1');
  $this
    ->assertEntity(2, 'image2.png', 'public://import/images/image2.png', 'image/png', '3974', '1');
  $this
    ->assertEntity(3, 'Thumbnail 1.png', 'public://import/images/Thumbnail%201.png', 'image/png', '3974', '1');
  $this
    ->assertEntity(6, 'TherMaxx 3mm - Black - Mens - Small.jpeg', 'public://import/images/TherMaxx%203mm%20-%20Black%20-%20Mens%20-%20Small.jpeg', 'image/jpeg', '4789', '1');
  $this
    ->assertEntity(20, 'Aquaseal 8oz.jpeg', 'public://import/images/Aquaseal%208oz.jpeg', 'image/jpeg', '6131', '1');
  $this
    ->assertEntity(21, 'Thumbnail 2.png', 'public://import/images/Thumbnail%202.png', 'image/png', '5424', '1');
  $this
    ->assertEntity(22, 'Zip Care.jpeg', 'public://import/images/Zip%20Care.jpeg', 'image/jpeg', '4789', '1');
  $this
    ->assertEntity(23, 'Thumbnail 3.png', 'public://import/images/Thumbnail%203.png', 'image/png', '3905', '1');
  $this
    ->assertEntity(34, 'Hero 5 - Black.jpeg', 'public://import/images/Hero%205%20-%20Black.jpeg', 'image/jpeg', '4789', '1');
  $this
    ->assertEntity(35, 'image3.png', 'public://import/images/image3.png', 'image/png', '3905', '1');

  // CTA files.
  $this
    ->assertEntity(4, 'flying.jpeg', 'public://import/images/flying.jpeg', 'image/jpeg', '4789', '1');
  $this
    ->assertEntity(5, 'rainbow.png', 'public://import/images/rainbow.png', 'image/png', '5424', '1');
}