|
@@ 184-200 (lines=17) @@
|
| 181 |
|
$this->assertEquals("linkcurrent", trim($response->getBody())); |
| 182 |
|
} |
| 183 |
|
|
| 184 |
|
public function testContentTypeHTML() |
| 185 |
|
{ |
| 186 |
|
StaticPublisherTestPage::remove_extension('FilesystemPublisher'); |
| 187 |
|
StaticPublisherTestPage::add_extension("FilesystemPublisher('assets/FilesystemPublisherTest-static-folder/', 'php')"); |
| 188 |
|
$l1 = new StaticPublisherTestPage(); |
| 189 |
|
$l1->URLSegment = 'mimetype'; |
| 190 |
|
$l1->write(); |
| 191 |
|
$l1->publishRecursive(); |
| 192 |
|
try { |
| 193 |
|
$response = Director::test('mimetype'); |
| 194 |
|
} catch (HTTPResponse_Exception $e) { |
| 195 |
|
$response = $e->getResponse(); |
| 196 |
|
} |
| 197 |
|
$this->assertEquals('text/html; charset=utf-8', $response->getHeader('Content-Type')); |
| 198 |
|
StaticPublisherTestPage::remove_extension('FilesystemPublisher'); |
| 199 |
|
StaticPublisherTestPage::add_extension('FilesystemPublisher'); |
| 200 |
|
} |
| 201 |
|
|
| 202 |
|
public function testContentTypeJSON() |
| 203 |
|
{ |
|
@@ 202-218 (lines=17) @@
|
| 199 |
|
StaticPublisherTestPage::add_extension('FilesystemPublisher'); |
| 200 |
|
} |
| 201 |
|
|
| 202 |
|
public function testContentTypeJSON() |
| 203 |
|
{ |
| 204 |
|
StaticPublisherTestPage::remove_extension('FilesystemPublisher'); |
| 205 |
|
StaticPublisherTestPage::add_extension("FilesystemPublisher('assets/FilesystemPublisherTest-static-folder/', 'php')"); |
| 206 |
|
$l1 = new StaticPublisherTestPage(); |
| 207 |
|
$l1->URLSegment = 'mimetype'; |
| 208 |
|
$l1->write(); |
| 209 |
|
$l1->publishRecursive(); |
| 210 |
|
try { |
| 211 |
|
$response = Director::test('mimetype/json'); |
| 212 |
|
} catch (HTTPResponse_Exception $e) { |
| 213 |
|
$response = $e->getResponse(); |
| 214 |
|
} |
| 215 |
|
$this->assertEquals('application/json', $response->getHeader('Content-Type')); |
| 216 |
|
StaticPublisherTestPage::remove_extension('FilesystemPublisher'); |
| 217 |
|
StaticPublisherTestPage::add_extension('FilesystemPublisher'); |
| 218 |
|
} |
| 219 |
|
} |
| 220 |
|
|