class MigrateImageTest
Same name and namespace in other branches
- 11.x core/modules/image/tests/src/Kernel/Migrate/d6/MigrateImageTest.php \Drupal\Tests\image\Kernel\Migrate\d6\MigrateImageTest
Image migration test.
This extends the node test, because the D6 fixture has images; they just need to be migrated into D8.
@group migrate_drupal_6
Hierarchy
- class \Drupal\KernelTests\KernelTestBase extends \Drupal\Core\DependencyInjection\ServiceProviderInterface uses \Drupal\KernelTests\AssertLegacyTrait, \Drupal\KernelTests\AssertContentTrait, \Drupal\Tests\RandomGeneratorTrait, \Drupal\Tests\ConfigTestTrait, \Drupal\Tests\ExtensionListTestTrait, \Drupal\Tests\TestRequirementsTrait, \Drupal\Tests\Traits\PhpUnitWarnings, \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait implements \PHPUnit\Framework\TestCase
- class \Drupal\Tests\migrate\Kernel\MigrateTestBase extends \Drupal\migrate\MigrateMessageInterface implements \Drupal\KernelTests\KernelTestBase
- class \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase implements \Drupal\Tests\migrate\Kernel\MigrateTestBase
- class \Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase uses \Drupal\Tests\migrate_drupal\Traits\NodeMigrateTypeTestTrait implements \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase
- class \Drupal\Tests\node\Kernel\Migrate\d6\MigrateNodeTestBase implements \Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase
- class \Drupal\Tests\image\Kernel\Migrate\d6\MigrateImageTest uses \Drupal\Tests\file\Kernel\Migrate\d6\FileMigrationTestTrait implements \Drupal\Tests\node\Kernel\Migrate\d6\MigrateNodeTestBase
- class \Drupal\Tests\node\Kernel\Migrate\d6\MigrateNodeTestBase implements \Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase
- class \Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase uses \Drupal\Tests\migrate_drupal\Traits\NodeMigrateTypeTestTrait implements \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase
- class \Drupal\Tests\migrate_drupal\Kernel\MigrateDrupalTestBase implements \Drupal\Tests\migrate\Kernel\MigrateTestBase
- class \Drupal\Tests\migrate\Kernel\MigrateTestBase extends \Drupal\migrate\MigrateMessageInterface implements \Drupal\KernelTests\KernelTestBase
Expanded class hierarchy of MigrateImageTest
File
-
core/
modules/ image/ tests/ src/ Kernel/ Migrate/ d6/ MigrateImageTest.php, line 17
Namespace
Drupal\Tests\image\Kernel\Migrate\d6View source
class MigrateImageTest extends MigrateNodeTestBase {
use FileMigrationTestTrait;
/**
* {@inheritdoc}
*/
protected static $modules = [
'menu_ui',
];
/**
* {@inheritdoc}
*/
protected function setUp() : void {
parent::setUp();
$this->setUpMigratedFiles();
$this->installSchema('file', [
'file_usage',
]);
$this->executeMigrations([
'd6_node',
]);
}
/**
* Tests image migration from Drupal 6 to 8.
*/
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);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.