From 5f1b9885b42e20a5544c6e0707f2ebba7fc50d6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 13 Jan 2014 21:43:26 +0100 Subject: [PATCH] [add] test for mark as unread --- tests/functionals/ApiTest.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/functionals/ApiTest.php b/tests/functionals/ApiTest.php index a715824..5e2f165 100644 --- a/tests/functionals/ApiTest.php +++ b/tests/functionals/ApiTest.php @@ -106,6 +106,36 @@ class ApiTest extends PocheWebTestCase } + public function testMarkAsUnread() + { + + //Load some entries + Fixtures::loadEntries($this->app['db']); + + $client = $this->createClient(); + $crawler = $client->request( + 'GET', + '/api/mark-unread', + 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('1', $client->getResponse()->getContent()); + + } + public function testPostEntries() {