|
@@ 45-59 (lines=15) @@
|
| 42 |
|
$this->assertEquals(0, strlen($response2->getContent())); |
| 43 |
|
} |
| 44 |
|
|
| 45 |
|
public function testGetAtom() |
| 46 |
|
{ |
| 47 |
|
$client = static::createClient(); |
| 48 |
|
|
| 49 |
|
$client->request('GET', '/atom/1'); |
| 50 |
|
|
| 51 |
|
$response = $client->getResponse(); |
| 52 |
|
$this->assertEquals('200', $response->getStatusCode()); |
| 53 |
|
$this->assertEquals('application/xhtml+xml', $response->headers->get('content-type')); |
| 54 |
|
|
| 55 |
|
$atom = new Document($response->getContent()); |
| 56 |
|
|
| 57 |
|
$standard = new Atom(new DateTimeBuilder(new NullLogger())); |
| 58 |
|
$this->assertTrue($standard->canHandle($atom)); |
| 59 |
|
} |
| 60 |
|
|
| 61 |
|
public function testGetRss() |
| 62 |
|
{ |
|
@@ 61-75 (lines=15) @@
|
| 58 |
|
$this->assertTrue($standard->canHandle($atom)); |
| 59 |
|
} |
| 60 |
|
|
| 61 |
|
public function testGetRss() |
| 62 |
|
{ |
| 63 |
|
$client = static::createClient(); |
| 64 |
|
|
| 65 |
|
$client->request('GET', '/rss/1'); |
| 66 |
|
|
| 67 |
|
$response = $client->getResponse(); |
| 68 |
|
$this->assertEquals('200', $response->getStatusCode()); |
| 69 |
|
$this->assertEquals('application/xhtml+xml', $response->headers->get('content-type')); |
| 70 |
|
|
| 71 |
|
$rss = new Document($response->getContent()); |
| 72 |
|
|
| 73 |
|
$standard = new Rss(new DateTimeBuilder(new NullLogger())); |
| 74 |
|
$this->assertTrue($standard->canHandle($rss)); |
| 75 |
|
} |
| 76 |
|
|
| 77 |
|
public function testGetJson() |
| 78 |
|
{ |
|
@@ 77-92 (lines=16) @@
|
| 74 |
|
$this->assertTrue($standard->canHandle($rss)); |
| 75 |
|
} |
| 76 |
|
|
| 77 |
|
public function testGetJson() |
| 78 |
|
{ |
| 79 |
|
$client = static::createClient(); |
| 80 |
|
|
| 81 |
|
$client->request('GET', '/json/1'); |
| 82 |
|
|
| 83 |
|
$response = $client->getResponse(); |
| 84 |
|
|
| 85 |
|
$this->assertEquals('200', $response->getStatusCode()); |
| 86 |
|
$this->assertEquals('application/json', $response->headers->get('content-type')); |
| 87 |
|
|
| 88 |
|
$json = new Document($response->getContent()); |
| 89 |
|
|
| 90 |
|
$standard = new Json(new DateTimeBuilder(new NullLogger())); |
| 91 |
|
$this->assertTrue($standard->canHandle($json)); |
| 92 |
|
} |
| 93 |
|
|
| 94 |
|
/** |
| 95 |
|
* @expectedException \Symfony\Component\HttpKernel\Exception\NotFoundHttpException |