diff --git a/core/lib/Thelia/Tests/Tools/MimeTypesToolsTest.php b/core/lib/Thelia/Tests/Tools/MimeTypesToolsTest.php deleted file mode 100644 index fc33cfda5..000000000 --- a/core/lib/Thelia/Tests/Tools/MimeTypesToolsTest.php +++ /dev/null @@ -1,122 +0,0 @@ - - */ -class MimeTypesToolsTest extends \PHPUnit_Framework_TestCase -{ - /** @var MimeTypeTools */ - protected $tool; - - public function setUp() - { - new Translator(new Container()); - - $this->tool = new MimeTypeTools(); - } - - public function testTrim() - { - $this->assertEquals( - "foo", - $this->tool->realTrim(" foo ") - ); - - $this->assertEquals( - "foo bar", - $this->tool->realTrim(" foo bar ") - ); - - $this->assertEquals( - "foo bar", - $this->tool->realTrim(" foo bar ") - ); - - $this->assertEquals( - "# foO/x-bar", - $this->tool->realTrim(" # foO/x-bar ") - ); - - $this->assertEquals( - "foO/x-bar bar baz", - $this->tool->realTrim(" foO/x-bar \t\t bar baz ") - ); - } - - public function testParseFile() - { - $array = $this->tool->parseFile(); - - /** - * check the format - */ - - foreach ($array as $key => $value) { - $this->assertTrue(is_string($key)); - - $this->assertTrue(is_array($value)); - - foreach ($value as $entry) { - $this->assertTrue(is_string($entry)); - } - } - } - - /** - * @expectedException \Thelia\Exception\FileException - */ - public function testParseFileFail() - { - $this->tool->parseFile("foo.bar"); - } - - public function testValidation() - { - $this->assertEquals( - MimeTypeTools::TYPE_MATCH, - $this->tool->validateMimeTypeExtension( - "image/png", "foo.png" - )); - - $this->assertEquals( - MimeTypeTools::TYPE_MATCH, - $this->tool->validateMimeTypeExtension( - "image/png", "foo.PNg" - )); - - $this->assertEquals( - MimeTypeTools::TYPE_NOT_MATCH, - $this->tool->validateMimeTypeExtension( - "image/png", "foo.jpeg" - )); - - $this->assertEquals( - MimeTypeTools::TYPE_UNKNOWN, - $this->tool->validateMimeTypeExtension( - "thismimetype/doesntexists", "foo.bar" - )); - - $this->assertEquals( - MimeTypeTools::TYPE_MATCH, - $this->tool->validateMimeTypeExtension( - "text/x-php", "foo.php" - )); - } -}