]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Add test when url doesn’t exist
authorJeremy Benoist <jeremy.benoist@gmail.com>
Sat, 1 Oct 2016 15:26:36 +0000 (17:26 +0200)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Sat, 1 Oct 2016 15:26:36 +0000 (17:26 +0200)
tests/Wallabag/ApiBundle/Controller/WallabagRestControllerTest.php

index e582e5f9c298924c912c92036e8fc7112257ed74..9b5760bcc98e3b6f8b0c45706eb9263ba90b6292 100644 (file)
@@ -695,4 +695,15 @@ class WallabagRestControllerTest extends WallabagApiTestCase
 
         $this->assertEquals(true, $content['exists']);
     }
+
+    public function testGetEntriesExistsWhichDoesNotExists()
+    {
+        $this->client->request('GET', '/api/entries/exists?url=http://google.com/entry2');
+
+        $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
+
+        $content = json_decode($this->client->getResponse()->getContent(), true);
+
+        $this->assertEquals(false, $content['exists']);
+    }
 }