You are here

public function MigrateImageTest::testNode in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/image/tests/src/Kernel/Migrate/d6/MigrateImageTest.php \Drupal\Tests\image\Kernel\Migrate\d6\MigrateImageTest::testNode()
  2. 9 core/modules/image/tests/src/Kernel/Migrate/d6/MigrateImageTest.php \Drupal\Tests\image\Kernel\Migrate\d6\MigrateImageTest::testNode()

Tests image migration from Drupal 6 to 8.

File

core/modules/image/tests/src/Kernel/Migrate/d6/MigrateImageTest.php, line 41

Class

MigrateImageTest
Image migration test.

Namespace

Drupal\Tests\image\Kernel\Migrate\d6

Code

public function testNode() {
  $node = Node::load(9);

  // Test the image field sub fields.
  $this
    ->assertSame('2', $node->field_test_imagefield->target_id);
  $this
    ->assertSame('Test alt', $node->field_test_imagefield->alt);
  $this
    ->assertSame('Test title', $node->field_test_imagefield->title);
  $this
    ->assertSame('80', $node->field_test_imagefield->width);
  $this
    ->assertSame('60', $node->field_test_imagefield->height);
}