public function testSetMimeType() { $ext = 'test_ext'; $type = 'foo'; $this->assertArrayNotHasKey($ext, $this->obj->_mimeTypes); $this->assertSame($this->obj, $this->obj->setMimeType($ext, $type)); $this->assertArrayHasKey($ext, $this->obj->_mimeTypes); $this->assertSame($this->obj->_mimeTypes[$ext], $type); }
<?php require_once dirname(__FILE__) . '/../ExpiresHeader.php'; try { $EH = new ExpiresHeader(); // Must $EH->setFile($_GET['file']); // Optional $EH->setConfig(array('days' => 7, 'gzip' => false)); // Optional $EH->setMimeType(array('html' => 'text/html', 'css' => 'text/css')); $EH->display(); } catch (ExpiresHeaderException $e) { header('HTTP', true, $e->getCode()); echo $e->getMessage(); exit(0); }