function MigrateUserPictureD6FileTest::assertEntity

Same name in other branches
  1. 9 core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserPictureD6FileTest.php \Drupal\Tests\user\Kernel\Migrate\d6\MigrateUserPictureD6FileTest::assertEntity()
  2. 10 core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserPictureD6FileTest.php \Drupal\Tests\user\Kernel\Migrate\d6\MigrateUserPictureD6FileTest::assertEntity()
  3. 11.x core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserPictureD6FileTest.php \Drupal\Tests\user\Kernel\Migrate\d6\MigrateUserPictureD6FileTest::assertEntity()

Asserts a file entity.

Parameters

int $fid: The file ID.

string $name: The expected file name.

int $size: The expected file size.

string $uri: The expected file URI.

string $type: The expected MIME type.

int $uid: The expected file owner ID.

1 call to MigrateUserPictureD6FileTest::assertEntity()
MigrateUserPictureD6FileTest::testUserPicturesWithD6File in core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserPictureD6FileTest.php
Tests the D6 user pictures migration in combination with D6 file.

File

core/modules/user/tests/src/Kernel/Migrate/d6/MigrateUserPictureD6FileTest.php, line 46

Class

MigrateUserPictureD6FileTest
User pictures migration.

Namespace

Drupal\Tests\user\Kernel\Migrate\d6

Code

protected function assertEntity($fid, $name, $size, $uri, $type, $uid) {
    
    /** @var \Drupal\file\FileInterface $file */
    $file = File::load($fid);
    $this->assertInstanceOf(FileInterface::class, $file);
    $this->assertSame($name, $file->getFilename());
    $this->assertSame($size, $file->getSize());
    $this->assertSame($uri, $file->getFileUri());
    $this->assertSame($type, $file->getMimeType());
    $this->assertSame($uid, $file->getOwnerId());
}

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