[HttpFoundation] remove getExtension method
This commit is contained in:
parent
995448c6ef
commit
55ecf3bc46
@ -87,20 +87,6 @@ class File extends \SplFileInfo
|
|||||||
return $guesser->guess($this->getPathname());
|
return $guesser->guess($this->getPathname());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the extension of the file.
|
|
||||||
*
|
|
||||||
* \SplFileInfo::getExtension() is not available before PHP 5.3.6
|
|
||||||
*
|
|
||||||
* @return string The extension
|
|
||||||
*
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
public function getExtension()
|
|
||||||
{
|
|
||||||
return pathinfo($this->getBasename(), PATHINFO_EXTENSION);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Moves the file to a new location.
|
* Moves the file to a new location.
|
||||||
*
|
*
|
||||||
|
@ -148,12 +148,6 @@ class FileTest extends \PHPUnit_Framework_TestCase
|
|||||||
@rmdir($targetDir);
|
@rmdir($targetDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGetExtension()
|
|
||||||
{
|
|
||||||
$file = new File(__DIR__.'/Fixtures/test.gif');
|
|
||||||
$this->assertEquals('gif', $file->getExtension());
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function createMockGuesser($path, $mimeType)
|
protected function createMockGuesser($path, $mimeType)
|
||||||
{
|
{
|
||||||
$guesser = $this->getMock('Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface');
|
$guesser = $this->getMock('Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesserInterface');
|
||||||
|
Reference in New Issue
Block a user