Skip to content

Commit

Permalink
Merge pull request #406 from andig/formattest
Browse files Browse the repository at this point in the history
Remove xml context, add txt
  • Loading branch information
andig committed Feb 15, 2016
2 parents 29b507d + 7d34823 commit 3a3b1de
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions test/FormatTest.php
Expand Up @@ -75,22 +75,14 @@ function testCSVInvalidUuidException() {
$this->assertEquals(400, $response->getStatusCode());
}

function testXML() {
$response = $this->getResponse(Request::create('/data/' . static::$uuid . '.xml', 'GET',
function testTxt() {
$response = $this->getResponse(Request::create('/data/' . static::$uuid . '.txt', 'GET',
array('from' => 0, 'to' => 'now')
));

$this->assertEquals(200, $response->getStatusCode());
$this->assertContains('application/xml', $response->headers->get('Content-Type'));
$this->assertContains(static::$uuid, $response->getContent());
}

function testXMLInvalidUuidException() {
$response = $this->getResponse(Request::create('/data/' . self::INVALID_UUID . '.xml', 'GET',
array('from' => 0, 'to' => 'now')
));

$this->assertEquals(400, $response->getStatusCode());
$this->assertContains('text/plain', $response->headers->get('Content-Type'));
$this->assertContains('W', $response->getContent());
}
}

Expand Down

0 comments on commit 3a3b1de

Please sign in to comment.