You are here

public function FileTest::testGuessExtensionWithReset in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Tests/File/FileTest.php \Symfony\Component\HttpFoundation\Tests\File\FileTest::testGuessExtensionWithReset()

@requires extension fileinfo

File

vendor/symfony/http-foundation/Tests/File/FileTest.php, line 51

Class

FileTest

Namespace

Symfony\Component\HttpFoundation\Tests\File

Code

public function testGuessExtensionWithReset() {
  $file = new File(__DIR__ . '/Fixtures/other-file.example');
  $guesser = $this
    ->createMockGuesser($file
    ->getPathname(), 'image/gif');
  MimeTypeGuesser::getInstance()
    ->register($guesser);
  $this
    ->assertEquals('gif', $file
    ->guessExtension());
  MimeTypeGuesser::reset();
  $this
    ->assertNull($file
    ->guessExtension());
}