You are here

protected function MigrateFileTest::assertEntity in Zircon Profile 8

Same name in this branch
  1. 8 core/modules/file/src/Tests/Migrate/d6/MigrateFileTest.php \Drupal\file\Tests\Migrate\d6\MigrateFileTest::assertEntity()
  2. 8 core/modules/file/src/Tests/Migrate/d7/MigrateFileTest.php \Drupal\file\Tests\Migrate\d7\MigrateFileTest::assertEntity()
Same name and namespace in other branches
  1. 8.0 core/modules/file/src/Tests/Migrate/d6/MigrateFileTest.php \Drupal\file\Tests\Migrate\d6\MigrateFileTest::assertEntity()

Asserts a file entity.

Parameters

integer $fid: The file ID.

string $name: The expected file name.

integer $size: The expected file size.

string $uri: The expected file URI.

string $type: The expected MIME type.

integer $uid: The expected file owner ID.

1 call to MigrateFileTest::assertEntity()
MigrateFileTest::testFiles in core/modules/file/src/Tests/Migrate/d6/MigrateFileTest.php
Tests the Drupal 6 files to Drupal 8 migration.

File

core/modules/file/src/Tests/Migrate/d6/MigrateFileTest.php, line 66
Contains \Drupal\file\Tests\Migrate\d6\MigrateFileTest.

Class

MigrateFileTest
file migration.

Namespace

Drupal\file\Tests\Migrate\d6

Code

protected function assertEntity($fid, $name, $size, $uri, $type, $uid) {

  /** @var \Drupal\file\FileInterface $file */
  $file = File::load($fid);
  $this
    ->assertTrue($file instanceof FileInterface);
  $this
    ->assertIdentical($name, $file
    ->getFilename());
  $this
    ->assertIdentical($size, $file
    ->getSize());
  $this
    ->assertIdentical($uri, $file
    ->getFileUri());
  $this
    ->assertIdentical($type, $file
    ->getMimeType());
  $this
    ->assertIdentical($uid, $file
    ->getOwnerId());
}