]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
test with bad headers
authorNicolas Lœuillet <nicolas@loeuillet.org>
Wed, 11 Feb 2015 14:35:40 +0000 (15:35 +0100)
committerNicolas Lœuillet <nicolas@loeuillet.org>
Wed, 11 Feb 2015 14:35:40 +0000 (15:35 +0100)
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()