public function testRegister() { $xml = Mad_Controller_Mime_Type::lookupByExtension("iphone"); $this->assertNull($xml); Mad_Controller_Mime_Type::register('text/iphone', 'apl', array('text/phone'), array('aap')); $iphone = Mad_Controller_Mime_Type::lookup("text/iphone"); $this->assertNotNull($iphone); $iphone = Mad_Controller_Mime_Type::lookupByExtension("apl"); $this->assertNotNull($iphone); }
public static function registerTypes() { if (!self::$registered) { Mad_Controller_Mime_Type::register("*/*", 'all'); Mad_Controller_Mime_Type::register("text/plain", 'text', array(), array('txt')); Mad_Controller_Mime_Type::register("text/html", 'html', array('application/xhtml+xml'), array('xhtml')); Mad_Controller_Mime_Type::register("text/javascript", 'js', array('application/javascript', 'application/x-javascript'), array('xhtml')); Mad_Controller_Mime_Type::register("text/csv", 'csv'); Mad_Controller_Mime_Type::register("application/xml", 'xml', array('text/xml', 'application/x-xml')); self::$registered = true; } }