[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/net/tests/cases/ -> lmbMimeTypeTest.class.php (source)

   1  <?php
   2  /*
   3   * Limb PHP Framework
   4   *
   5   * @link http://limb-project.com 
   6   * @copyright  Copyright &copy; 2004-2007 BIT(http://bit-creative.com)
   7   * @license    LGPL http://www.gnu.org/copyleft/lesser.html 
   8   */
   9  lmb_require('limb/net/src/lmbMimeType.class.php');
  10  
  11  class lmbMimeTypeTest extends UnitTestCase
  12  {
  13    function getExtensionFailed()
  14    {
  15      $this->assertNull(lmbMimeType :: getExtension('foo'));
  16    }
  17  
  18    function testGetExtension()
  19    {
  20      $this->assertEqual(lmbMimeType :: getExtension('text/html'), 'html');
  21      $this->assertEqual(lmbMimeType :: getExtension('text/rtf'), 'rtf');
  22    }
  23  
  24    function testGetMimeTypeForExtensionFailed()
  25    {
  26      $this->assertNull(lmbMimeType :: getMimeType('booo'));
  27    }
  28  
  29    function testGetMimeTypeForExtension()
  30    {
  31      $this->assertEqual(lmbMimeType :: getMimeType('html'), 'text/html');
  32      $this->assertEqual(lmbMimeType :: getMimeType('rtf'), 'text/rtf');
  33    }
  34  
  35    function testGetMimeTypeExtensionWithDot()
  36    {
  37      $this->assertEqual(lmbMimeType :: getMimeType('.html'), 'text/html');
  38      $this->assertEqual(lmbMimeType :: getMimeType('.rtf'), 'text/rtf');
  39    }
  40  
  41    function testGetMimeTypeForFileFailed()
  42    {
  43      $this->assertNull(lmbMimeType :: getFileMimeType('booo.fg'));
  44    }
  45  
  46    function testGetMimeTypeForFile()
  47    {
  48      $this->assertEqual(lmbMimeType :: getFileMimeType('test.html'), 'text/html');
  49      $this->assertEqual(lmbMimeType :: getFileMimeType('test.rtf'), 'text/rtf');
  50    }
  51  }
  52  ?>


Generated: Sat Nov 22 03:48:54 2008 Cross-referenced by PHPXref 0.7