public function testProvidingParametersIntroducesHeaderFolding() { $header = new ContentType(); $header->setType('application/x-unit-test'); $header->addParameter('charset', 'us-ascii'); $string = $header->toString(); $this->assertContains("Content-Type: application/x-unit-test;\r\n", $string); $this->assertContains(";\r\n charset=\"us-ascii\"", $string); }
/** * @group #2728 * * Tests setting different MIME types */ public function testSetContentType() { $header = new ContentType(); $header->setType('application/vnd.ms-excel'); $this->assertEquals('Content-Type: application/vnd.ms-excel', $header->toString()); $header->setType('application/rss+xml'); $this->assertEquals('Content-Type: application/rss+xml', $header->toString()); $header->setType('video/mp4'); $this->assertEquals('Content-Type: video/mp4', $header->toString()); $header->setType('message/rfc822'); $this->assertEquals('Content-Type: message/rfc822', $header->toString()); }