+ /**
+ * Tests a single file entity.
+ *
+ * @param int $id
+ * The file ID.
+ * @param string $name
+ * The expected file name.
+ * @param string $uri
+ * The expected URI.
+ * @param string $mime
+ * The expected MIME type.
+ * @param string $size
+ * The expected file size.
+ * @param string $created
+ * The expected creation time.
+ * @param string $changed
+ * The expected modification time.
+ * @param string $uid
+ * The expected owner ID.
+ */
+ protected function assertEntity($id, $name, $uri, $mime, $size, $created, $changed, $uid) {
+ /** @var \Drupal\file\FileInterface $file */
+ $file = File::load($id);
+ $this->assertInstanceOf(FileInterface::class, $file);
+ $this->assertSame($name, $file->getFilename());
+ $this->assertSame($uri, $file->getFileUri());
+ $this->assertFileExists($uri);
+ $this->assertSame($mime, $file->getMimeType());
+ $this->assertSame($size, $file->getSize());
+ // isPermanent(), isTemporary(), etc. are determined by the status column.
+ $this->assertTrue($file->isPermanent());
+ $this->assertSame($created, $file->getCreatedTime());
+ $this->assertSame($changed, $file->getChangedTime());
+ $this->assertSame($uid, $file->getOwnerId());
+ }
+