From 9ca5fd43f9cd3dbf00511748492298aaf3145575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Wed, 11 Feb 2015 15:35:40 +0100 Subject: test with bad headers --- .../CoreBundle/Tests/Controller/WallabagRestControllerTest.php | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php index 815903fa..b4831167 100644 --- a/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php @@ -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() -- cgit v1.2.3