]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php
test with bad headers
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Tests / Controller / WallabagRestControllerTest.php
index 815903fad6a759f14fcb619f3785122da824604c..b483116743cad5e1ff20918a911fe0e1baa1c7f6 100644 (file)
@@ -67,6 +67,15 @@ class WallabagRestControllerTest extends WallabagTestCase
                 'application/json'
             )
         );
+
+        // Now testing with bad headers
+        $badHeaders = array(
+            'HTTP_AUTHORIZATION' => 'Authorization profile="UsernameToken"',
+            'HTTP_x-wsse' => 'X-WSSE: UsernameToken Username="admin", PasswordDigest="Wr0ngDig3st", Nonce="n0Nc3", Created="2015-01-01T13:37:00Z"',
+        );
+
+        $client->request('GET', '/api/entries/'.$entry->getId().'.json', array(), array(), $badHeaders);
+        $this->assertEquals(403, $client->getResponse()->getStatusCode());
     }
 
     public function testGetEntries()