[limb-svn] r6746 - 3.x/trunk/limb/net/tests/cases

svn at limb-project.com svn at limb-project.com
Thu Jan 24 19:47:30 MSK 2008


Author: vasiatka
Date: 2008-01-24 19:47:30 +0300 (Thu, 24 Jan 2008)
New Revision: 6746
URL: http://fisheye.limb-project.com/changelog/limb/?cs=6746

Modified:
   3.x/trunk/limb/net/tests/cases/lmbMimeTypeTest.class.php
Log:
added testGetSameExtensionForDifferentMimeTypes

Modified: 3.x/trunk/limb/net/tests/cases/lmbMimeTypeTest.class.php
===================================================================
--- 3.x/trunk/limb/net/tests/cases/lmbMimeTypeTest.class.php	2008-01-24 16:44:39 UTC (rev 6745)
+++ 3.x/trunk/limb/net/tests/cases/lmbMimeTypeTest.class.php	2008-01-24 16:47:30 UTC (rev 6746)
@@ -1,52 +1,62 @@
-<?php
-/*
- * Limb PHP Framework
- *
- * @link http://limb-project.com 
- * @copyright  Copyright &copy; 2004-2007 BIT(http://bit-creative.com)
- * @license    LGPL http://www.gnu.org/copyleft/lesser.html 
- */
-lmb_require('limb/net/src/lmbMimeType.class.php');
-
-class lmbMimeTypeTest extends UnitTestCase
-{
-  function getExtensionFailed()
-  {
-    $this->assertNull(lmbMimeType :: getExtension('foo'));
-  }
-
-  function testGetExtension()
-  {
-    $this->assertEqual(lmbMimeType :: getExtension('text/html'), 'html');
-    $this->assertEqual(lmbMimeType :: getExtension('text/rtf'), 'rtf');
-  }
-
-  function testGetMimeTypeForExtensionFailed()
-  {
-    $this->assertNull(lmbMimeType :: getMimeType('booo'));
-  }
-
-  function testGetMimeTypeForExtension()
-  {
-    $this->assertEqual(lmbMimeType :: getMimeType('html'), 'text/html');
-    $this->assertEqual(lmbMimeType :: getMimeType('rtf'), 'text/rtf');
-  }
-
-  function testGetMimeTypeExtensionWithDot()
-  {
-    $this->assertEqual(lmbMimeType :: getMimeType('.html'), 'text/html');
-    $this->assertEqual(lmbMimeType :: getMimeType('.rtf'), 'text/rtf');
-  }
-
-  function testGetMimeTypeForFileFailed()
-  {
-    $this->assertNull(lmbMimeType :: getFileMimeType('booo.fg'));
-  }
-
-  function testGetMimeTypeForFile()
-  {
-    $this->assertEqual(lmbMimeType :: getFileMimeType('test.html'), 'text/html');
-    $this->assertEqual(lmbMimeType :: getFileMimeType('test.rtf'), 'text/rtf');
-  }
-}
-
+<?php
+/*
+ * Limb PHP Framework
+ *
+ * @link http://limb-project.com
+ * @copyright  Copyright &copy; 2004-2007 BIT(http://bit-creative.com)
+ * @license    LGPL http://www.gnu.org/copyleft/lesser.html
+ */
+lmb_require('limb/net/src/lmbMimeType.class.php');
+
+class lmbMimeTypeTest extends UnitTestCase
+{
+  function getExtensionFailed()
+  {
+    $this->assertNull(lmbMimeType :: getExtension('foo'));
+  }
+
+  function testGetExtension()
+  {
+    $this->assertEqual(lmbMimeType :: getExtension('text/html'), 'html');
+    $this->assertEqual(lmbMimeType :: getExtension('text/rtf'), 'rtf');
+  }
+
+  function testGetMimeTypeForExtensionFailed()
+  {
+    $this->assertNull(lmbMimeType :: getMimeType('booo'));
+  }
+
+  function testGetMimeTypeForExtension()
+  {
+    $this->assertEqual(lmbMimeType :: getMimeType('html'), 'text/html');
+    $this->assertEqual(lmbMimeType :: getMimeType('rtf'), 'text/rtf');
+  }
+
+  function testGetMimeTypeExtensionWithDot()
+  {
+    $this->assertEqual(lmbMimeType :: getMimeType('.html'), 'text/html');
+    $this->assertEqual(lmbMimeType :: getMimeType('.rtf'), 'text/rtf');
+  }
+
+  function testGetMimeTypeForFileFailed()
+  {
+    $this->assertNull(lmbMimeType :: getFileMimeType('booo.fg'));
+  }
+
+  function testGetMimeTypeForFile()
+  {
+    $this->assertEqual(lmbMimeType :: getFileMimeType('test.html'), 'text/html');
+    $this->assertEqual(lmbMimeType :: getFileMimeType('test.rtf'), 'text/rtf');
+  }
+
+
+  function testGetSameExtensionForDifferentMimeTypes()
+  {
+    $this->assertEqual(lmbMimeType :: getExtension('application/x-zip-compressed'), 'zip');
+    $this->assertEqual(lmbMimeType :: getExtension('application/zip'), 'zip');
+    $this->assertEqual(lmbMimeType :: getExtension('application/x-rar-compressed'), 'rar');
+    $this->assertEqual(lmbMimeType :: getExtension('application/rar'), 'rar');
+  }
+
+}
+



More information about the limb-svn mailing list