You are here

public function ImageTest::testFileMigration in Commerce Migrate 3.1.x

Same name in this branch
  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.1.x 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. 8.2 modules/magento/tests/src/Kernel/Migrate/magento2/ImageTest.php \Drupal\Tests\commerce_migrate_magento\Kernel\Migrate\magento2\ImageTest::testFileMigration()
  2. 3.0.x modules/magento/tests/src/Kernel/Migrate/magento2/ImageTest.php \Drupal\Tests\commerce_migrate_magento\Kernel\Migrate\magento2\ImageTest::testFileMigration()

Tests image file migration from CSV source file.

File

modules/magento/tests/src/Kernel/Migrate/magento2/ImageTest.php, line 54

Class

ImageTest
Migrate images.

Namespace

Drupal\Tests\commerce_migrate_magento\Kernel\Migrate\magento2

Code

public function testFileMigration() {

  // Test a base image.
  $this
    ->assertFileEntity(1, 'mb01-blue-0.jpg', 'public://import/images/catalog/product/m/b/mb01-blue-0.jpg', 'image/jpeg', '246955', '1');

  // Test a small image.
  $this
    ->assertFileEntity(2, 'msh02-black_main.jpg', 'public://import/images/catalog/product/m/s/msh02-black_main.jpg', 'image/jpeg', '45378', '1');

  // Test a thumbnail image.
  $this
    ->assertFileEntity(3, 'wb01-black-0.jpg', 'public://import/images/catalog/product/w/b/wb01-black-0.jpg', 'image/jpeg', '112042', '1');

  // Test a swatch.
  $this
    ->assertFileEntity(4, 'mb02-gray-0.jpg', 'public://import/images/catalog/product/m/b/mb02-gray-0.jpg', 'image/jpeg', '348654', '1');

  // Test an additional image.
  $this
    ->assertFileEntity(5, 'mb02-blue-0.jpg', 'public://import/images/catalog/product/m/b/mb02-blue-0.jpg', 'image/jpeg', '408574', '1');
}