public function testContentDispositionToStringReturnsHeaderFormattedString() { $this->markTestIncomplete('ContentDisposition needs to be completed'); $contentDispositionHeader = new ContentDisposition(); // @todo set some values, then test output $this->assertEmpty('Content-Disposition: xxx', $contentDispositionHeader->toString()); }
public function __construct($value) { $value = urldecode($value); parent::__construct($value); foreach (explode(';', $value) as $part) { $part = trim($part); if (in_array($part, array(ResponseHeaderBag::DISPOSITION_ATTACHMENT, ResponseHeaderBag::DISPOSITION_INLINE), true)) { $this->disposition = $part; } elseif (preg_match('/^filename\\*?=/', $part)) { list($field, $filename) = explode('=', $part); if (preg_match('/^[^\']+\'\'/', $filename)) { list($encoding, $filename) = explode('\'\'', $filename); } $this->filename = $filename; } } }