MigrateUserPictureFieldTest.php

Same filename in other branches
  1. 9 core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserPictureFieldTest.php
  2. 8.9.x core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserPictureFieldTest.php
  3. 10 core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserPictureFieldTest.php

Namespace

Drupal\Tests\user\Kernel\Migrate\d7

File

core/modules/user/tests/src/Kernel/Migrate/d7/MigrateUserPictureFieldTest.php

View source
<?php

declare (strict_types=1);
namespace Drupal\Tests\user\Kernel\Migrate\d7;

use Drupal\field\Entity\FieldStorageConfig;
use Drupal\field\FieldStorageConfigInterface;
use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;

/**
 * User picture field migration.
 *
 * @group user
 */
class MigrateUserPictureFieldTest extends MigrateDrupal7TestBase {
    
    /**
     * {@inheritdoc}
     */
    protected static $modules = [
        'image',
        'file',
    ];
    
    /**
     * {@inheritdoc}
     */
    protected function setUp() : void {
        parent::setUp();
        $this->executeMigration('user_picture_field');
    }
    
    /**
     * Tests the user picture field migration.
     */
    public function testUserPictureField() : void {
        
        /** @var \Drupal\field\FieldStorageConfigInterface $field_storage */
        $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());
    }

}

Classes

Title Deprecated Summary
MigrateUserPictureFieldTest User picture field migration.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.