function FileManagedTestBase::assertSameFile
Asserts that two files are the same by comparing the fid and filepath.
Parameters
\Drupal\file\FileInterface $file1: File object to compare.
\Drupal\file\FileInterface $file2: File object to compare.
File
- 
              core/
modules/ file/ tests/ src/ Functional/ FileManagedTestBase.php, line 129  
Class
- FileManagedTestBase
 - Provides a base class for testing files with the file_test module.
 
Namespace
Drupal\Tests\file\FunctionalCode
public function assertSameFile(FileInterface $file1, FileInterface $file2) {
  $this->assertEquals($file1->id(), $file2->id());
  $this->assertEquals($file1->getFileUri(), $file2->getFileUri());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.