public function testRegisterTypes() { Mad_Controller_Mime_Type::$registered = false; Mad_Controller_Mime_Type::$set = array(); $this->assertTrue(empty(Mad_Controller_Mime_Type::$set)); Mad_Controller_Mime_Type::registerTypes(); $this->assertFalse(empty(Mad_Controller_Mime_Type::$set)); }
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; } }