forked from ezsystems/ezpublish-kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EZP-20321: Refactored MimeTypeDetector
- Loading branch information
Bertrand Dunogier
committed
Mar 9, 2013
1 parent
fe9b3db
commit 315ad01
Showing
6 changed files
with
82 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
eZ/Publish/Core/IO/Tests/MimeTypeDetector/FileInfoTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
/** | ||
* File containing the FileInfoTest class. | ||
* | ||
* @copyright Copyright (C) 2013 eZ Systems AS. All rights reserved. | ||
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2 | ||
* @version //autogentag// | ||
*/ | ||
namespace eZ\Publish\Core\IO\Tests\MimeTypeDetector; | ||
|
||
use eZ\Publish\Core\IO\MimeTypeDetector\FileInfo as MimeTypeDetector; | ||
|
||
class FileInfoTest extends \PHPUnit_Framework_TestCase | ||
{ | ||
/** @var MimeTypeDetector */ | ||
protected $mimeTypeDetector; | ||
|
||
public function setUp() | ||
{ | ||
$this->mimeTypeDetector = new MimeTypeDetector; | ||
} | ||
|
||
public function testGetFromPath() | ||
{ | ||
self::assertEquals( | ||
$this->mimeTypeDetector->getFromPath( __FILE__ ), | ||
'text/x-php' | ||
); | ||
} | ||
|
||
public function testGetFromBuffer() | ||
{ | ||
self::assertEquals( | ||
$this->mimeTypeDetector->getFromBuffer( file_get_contents( __FILE__ ) ), | ||
'text/x-php' | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters