芝麻web文件管理V1.00
编辑当前文件:/home/strato/chroot/opt/RZphp80/includes/test/MIME_Type/tests/MIME_Type_ExtensionTest.php
mte = new MIME_Type_Extension; } public function testGetMIMEType() { $this->assertEquals('text/plain', $this->mte->getMIMEType('a.txt')); $this->assertEquals('text/plain', $this->mte->getMIMEType('/path/to/a.txt')); $this->assertEquals('image/png', $this->mte->getMIMEType('a.png')); $this->assertEquals('application/vnd.oasis.opendocument.text', $this->mte->getMIMEType('a.odt')); } public function testGetMIMETypeUppercase() { $this->assertEquals('text/plain', $this->mte->getMIMEType('a.TXT')); } public function testGetMIMETypeFullPath() { $this->assertEquals('text/plain', $this->mte->getMIMEType('/path/to/a.txt')); $this->assertEquals('text/plain', $this->mte->getMIMEType('C:\\Programs\\blubbr.txt')); } public function testGetMIMETypeNoExtension() { $this->assertInstanceOf('PEAR_Error', $this->mte->getMIMEType('file')); $this->assertInstanceOf('PEAR_Error', $this->mte->getMIMEType('blubbr')); } public function testGetMIMETypeFullPathNoExtension() { $this->assertInstanceOf('PEAR_Error', $this->mte->getMIMEType('/path/to/file')); $this->assertInstanceOf('PEAR_Error', $this->mte->getMIMEType('C:\\Programs\\blubbr')); } public function testGetMIMETypeUnknownExtension() { $this->assertInstanceOf('PEAR_Error', $this->mte->getMIMEType('file.ohmygodthatisnoextension')); } public function testGetExtension() { $this->assertEquals('atom', $this->mte->getExtension('application/atom+xml')); $this->assertEquals('csv', $this->mte->getExtension('text/csv')); } public function testGetExtensionFail() { $this->assertInstanceOf('PEAR_Error', $this->mte->getExtension(null)); $this->assertInstanceOf('PEAR_Error', $this->mte->getExtension('')); $this->assertInstanceOf('PEAR_Error', $this->mte->getExtension('n')); $this->assertInstanceOf('PEAR_Error', $this->mte->getExtension('n/n')); } } ?>