]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Test for GET on empty database
authorNicolas Lœuillet <nicolas@loeuillet.org>
Fri, 6 Feb 2015 17:02:12 +0000 (18:02 +0100)
committerNicolas Lœuillet <nicolas@loeuillet.org>
Wed, 11 Feb 2015 05:27:04 +0000 (06:27 +0100)
src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php [new file with mode: 0644]

diff --git a/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php
new file mode 100644 (file)
index 0000000..0949b92
--- /dev/null
@@ -0,0 +1,22 @@
+<?php
+
+namespace Wallabag\CoreBundle\Tests\Controller;
+
+use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
+
+class WallabagRestControllerTest extends WebTestCase
+{
+    public function testEmptyGetEntries() {
+        $client = $this->createClient();
+        $client->request('GET', '/api/entries');
+        $this->assertTrue($client->getResponse()->isOk());
+
+        $this->assertTrue(
+            $client->getResponse()->headers->contains(
+                'Content-Type',
+                'application/json'
+            )
+        );
+        $this->assertEquals('[]', $client->getResponse()->getContent());
+    }
+}
\ No newline at end of file