aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2015-02-11 06:31:16 +0100
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2015-02-11 06:31:16 +0100
commit2725de8efb7fd3af9b1d5b12a137d21e4adc5b10 (patch)
tree05a462725281de967ddb851ecaaf92fd162fc3a5 /src
parent91f78f26f2594db3f21c712f3ec30e4d06283dff (diff)
downloadwallabag-2725de8efb7fd3af9b1d5b12a137d21e4adc5b10.tar.gz
wallabag-2725de8efb7fd3af9b1d5b12a137d21e4adc5b10.tar.zst
wallabag-2725de8efb7fd3af9b1d5b12a137d21e4adc5b10.zip
cs
Diffstat (limited to 'src')
-rw-r--r--src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php
index ff3c9432..274a816f 100644
--- a/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php
@@ -3,7 +3,6 @@
3namespace Wallabag\CoreBundle\Tests\Controller; 3namespace Wallabag\CoreBundle\Tests\Controller;
4 4
5use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; 5use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
6use Symfony\Component\Security\Core\Encoder\MessageDigestPasswordEncoder;
7 6
8class WallabagRestControllerTest extends WebTestCase 7class WallabagRestControllerTest extends WebTestCase
9{ 8{
@@ -31,13 +30,13 @@ class WallabagRestControllerTest extends WebTestCase
31 $nonce = substr(md5(uniqid('nonce_', true)), 0, 16); 30 $nonce = substr(md5(uniqid('nonce_', true)), 0, 16);
32 31
33 $now = new \DateTime('now', new \DateTimeZone('UTC')); 32 $now = new \DateTime('now', new \DateTimeZone('UTC'));
34 $created = (string)$now->format( 'Y-m-d\TH:i:s\Z' ); 33 $created = (string) $now->format('Y-m-d\TH:i:s\Z');
35 $digest = base64_encode(sha1(base64_decode($nonce).$created.$encryptedPassword, true)); 34 $digest = base64_encode(sha1(base64_decode($nonce).$created.$encryptedPassword, true));
36 35
37 $headers = array( 36 $headers = array(
38 'PHP_AUTH_USER' => 'username', 37 'PHP_AUTH_USER' => 'username',
39 'HTTP_AUTHORIZATION' => 'Authorization profile="UsernameToken"', 38 'HTTP_AUTHORIZATION' => 'Authorization profile="UsernameToken"',
40 'HTTP_x-wsse' => 'X-WSSE: UsernameToken Username="'.$username.'", PasswordDigest="'.$digest.'", Nonce="'.$nonce.'", Created="'.$created.'"' 39 'HTTP_x-wsse' => 'X-WSSE: UsernameToken Username="'.$username.'", PasswordDigest="'.$digest.'", Nonce="'.$nonce.'", Created="'.$created.'"',
41 ); 40 );
42 41
43 $client->request('GET', '/api/entries', array(), array(), $headers); 42 $client->request('GET', '/api/entries', array(), array(), $headers);