diff --git a/tests/functionals/ApiTest.php b/tests/functionals/ApiTest.php index 788058b..93c4c0a 100644 --- a/tests/functionals/ApiTest.php +++ b/tests/functionals/ApiTest.php @@ -76,6 +76,36 @@ class ApiTest extends PocheWebTestCase } + public function testMarkAsRead() + { + + //Load some entries + Fixtures::loadEntries($this->app['db']); + + $client = $this->createClient(); + $crawler = $client->request( + 'GET', + '/api/mark-read', + array(), + array(), + array('CONTENT_TYPE' => 'application/json'), + '{"id":"1"}' + ); + + $this->assertEquals($client->getResponse()->getStatusCode(), 201); + + // Assert that the "Content-Type" header is "application/json" + $this->assertTrue( + $client->getResponse()->headers->contains( + 'Content-Type', + 'application/json' + ) + ); + + $this->assertEquals('true', $client->getResponse()->getContent()); + + } + public function testPostEntries() {