|
@@ 190-201 (lines=12) @@
|
| 187 |
|
$this->assertEquals(trim($response->getBody()), "linkcurrent", "current page is level 2-2"); |
| 188 |
|
} |
| 189 |
|
|
| 190 |
|
public function testContentTypeHTML() { |
| 191 |
|
StaticPublisherTestPage::remove_extension('FilesystemPublisher'); |
| 192 |
|
StaticPublisherTestPage::add_extension("FilesystemPublisher('assets/FilesystemPublisherTest-static-folder/', 'php')"); |
| 193 |
|
$l1 = new StaticPublisherTestPage(); |
| 194 |
|
$l1->URLSegment = 'mimetype'; |
| 195 |
|
$l1->write(); |
| 196 |
|
$l1->doPublish(); |
| 197 |
|
$response = Director::test('mimetype'); |
| 198 |
|
$this->assertEquals($response->getHeader('Content-Type'), 'text/html; charset=utf-8', 'Content-Type should be text/html; charset=utf-8'); |
| 199 |
|
StaticPublisherTestPage::remove_extension('FilesystemPublisher'); |
| 200 |
|
StaticPublisherTestPage::add_extension('FilesystemPublisher'); |
| 201 |
|
} |
| 202 |
|
|
| 203 |
|
public function testContentTypeJSON() { |
| 204 |
|
StaticPublisherTestPage::remove_extension('FilesystemPublisher'); |
|
@@ 203-214 (lines=12) @@
|
| 200 |
|
StaticPublisherTestPage::add_extension('FilesystemPublisher'); |
| 201 |
|
} |
| 202 |
|
|
| 203 |
|
public function testContentTypeJSON() { |
| 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->doPublish(); |
| 210 |
|
$response = Director::test('mimetype/json'); |
| 211 |
|
$this->assertEquals($response->getHeader('Content-Type'), 'application/json', 'Content-Type should be application/json'); |
| 212 |
|
StaticPublisherTestPage::remove_extension('FilesystemPublisher'); |
| 213 |
|
StaticPublisherTestPage::add_extension('FilesystemPublisher'); |
| 214 |
|
} |
| 215 |
|
} |
| 216 |
|
|
| 217 |
|
/** |