3 namespace Drupal\Tests\image\Kernel\Migrate\d6;
5 use Drupal\node\Entity\Node;
6 use Drupal\Tests\node\Kernel\Migrate\d6\MigrateNodeTestBase;
7 use Drupal\Tests\file\Kernel\Migrate\d6\FileMigrationTestTrait;
10 * Image migration test.
12 * This extends the node test, because the D6 fixture has images; they just
13 * need to be migrated into D8.
15 * @group migrate_drupal_6
17 class MigrateImageTest extends MigrateNodeTestBase {
19 use FileMigrationTestTrait;
24 public static $modules = ['menu_ui'];
29 protected function setUp() {
31 $this->setUpMigratedFiles();
32 $this->installSchema('file', ['file_usage']);
33 $this->executeMigrations([
39 * Test image migration from Drupal 6 to 8.
41 public function testNode() {
42 $node = Node::load(9);
43 // Test the image field sub fields.
44 $this->assertSame('2', $node->field_test_imagefield->target_id);
45 $this->assertSame('Test alt', $node->field_test_imagefield->alt);
46 $this->assertSame('Test title', $node->field_test_imagefield->title);
47 $this->assertSame('80', $node->field_test_imagefield->width);
48 $this->assertSame('60', $node->field_test_imagefield->height);