MigrateUserPictureFieldTest.php in Drupal 10
File
core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserPictureFieldTest.php
View source
<?php
namespace Drupal\Tests\user\Kernel\Migrate\d7;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\field\FieldStorageConfigInterface;
use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
class MigrateUserPictureFieldTest extends MigrateDrupal7TestBase {
protected static $modules = [
'image',
'file',
];
protected function setUp() : void {
parent::setUp();
$this
->executeMigration('user_picture_field');
}
public function testUserPictureField() {
$field_storage = FieldStorageConfig::load('user.user_picture');
$this
->assertInstanceOf(FieldStorageConfigInterface::class, $field_storage);
$this
->assertSame('user.user_picture', $field_storage
->id());
$this
->assertSame('image', $field_storage
->getType());
$this
->assertSame('user', $field_storage
->getTargetEntityTypeId());
}
}