MigrateImageTest.php in Drupal 9
File
core/modules/image/tests/src/Kernel/Migrate/d6/MigrateImageTest.php
View source
<?php
namespace Drupal\Tests\image\Kernel\Migrate\d6;
use Drupal\node\Entity\Node;
use Drupal\Tests\node\Kernel\Migrate\d6\MigrateNodeTestBase;
use Drupal\Tests\file\Kernel\Migrate\d6\FileMigrationTestTrait;
class MigrateImageTest extends MigrateNodeTestBase {
use FileMigrationTestTrait;
protected static $modules = [
'menu_ui',
];
protected function setUp() : void {
parent::setUp();
$this
->setUpMigratedFiles();
$this
->installSchema('file', [
'file_usage',
]);
$this
->executeMigrations([
'd6_node',
]);
}
public function testNode() {
$node = Node::load(9);
$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);
}
}