From 29c0aa03689458c0da264def99a62c253ef97f18 Mon Sep 17 00:00:00 2001 From: Benjamin Perche Date: Mon, 4 Aug 2014 10:47:38 +0200 Subject: [PATCH] =?UTF-8?q?Remove=20MimeTypeTools=20tests=20=09supprim?= =?UTF-8?q?=C3=A9:=20=20=20=20=20=20=20=20core/lib/Thelia/Tests/Tools/Mime?= =?UTF-8?q?TypesToolsTest.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Thelia/Tests/Tools/MimeTypesToolsTest.php | 122 ------------------ 1 file changed, 122 deletions(-) delete mode 100644 core/lib/Thelia/Tests/Tools/MimeTypesToolsTest.php 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" - )); - } -}