From 8936792f6f7a408dae7e0a6a41274202822acd9c Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Tue, 16 Feb 2016 21:12:43 -0500 Subject: Add file attachements to projects --- tests/units/Helper/FileHelperText.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'tests/units/Helper') diff --git a/tests/units/Helper/FileHelperText.php b/tests/units/Helper/FileHelperText.php index a681c890..2c6bc6ad 100644 --- a/tests/units/Helper/FileHelperText.php +++ b/tests/units/Helper/FileHelperText.php @@ -8,8 +8,20 @@ class FileHelperTest extends Base { public function testIcon() { - $h = new File($this->container); - $this->assertEquals('fa-file-image-o', $h->icon('test.png')); - $this->assertEquals('fa-file-o', $h->icon('test')); + $helper = new File($this->container); + $this->assertEquals('fa-file-image-o', $helper->icon('test.png')); + $this->assertEquals('fa-file-o', $helper->icon('test')); + } + + public function testGetMimeType() + { + $helper = new File($this->container); + + $this->assertEquals('image/jpeg', $helper->getImageMimeType('My File.JPG')); + $this->assertEquals('image/jpeg', $helper->getImageMimeType('My File.jpeg')); + $this->assertEquals('image/png', $helper->getImageMimeType('My File.PNG')); + $this->assertEquals('image/gif', $helper->getImageMimeType('My File.gif')); + $this->assertEquals('image/jpeg', $helper->getImageMimeType('My File.bmp')); + $this->assertEquals('image/jpeg', $helper->getImageMimeType('My File')); } } -- cgit v1.2.3