aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2015-02-11 15:15:06 +0100
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2015-02-11 15:15:06 +0100
commitf170f315941b461a2bcd85843583baedbc48efd2 (patch)
tree673b02fc2cd39dc3b2ed7184dc37509e5255b541 /src/Wallabag
parent874e3e10a45a5b3c662bac1112bbdc1acb0adb95 (diff)
downloadwallabag-f170f315941b461a2bcd85843583baedbc48efd2.tar.gz
wallabag-f170f315941b461a2bcd85843583baedbc48efd2.tar.zst
wallabag-f170f315941b461a2bcd85843583baedbc48efd2.zip
add test for empty salt
Diffstat (limited to 'src/Wallabag')
-rw-r--r--src/Wallabag/CoreBundle/Controller/WallabagRestController.php2
-rw-r--r--src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/WallabagRestController.php b/src/Wallabag/CoreBundle/Controller/WallabagRestController.php
index 3cfb8a77..e9cd8c93 100644
--- a/src/Wallabag/CoreBundle/Controller/WallabagRestController.php
+++ b/src/Wallabag/CoreBundle/Controller/WallabagRestController.php
@@ -33,7 +33,7 @@ class WallabagRestController extends Controller
33 throw $this->createNotFoundException(); 33 throw $this->createNotFoundException();
34 } 34 }
35 35
36 return array($user->getSalt()); 36 return array($user->getSalt() ?: null);
37 } 37 }
38 /** 38 /**
39 * Retrieve all entries. It could be filtered by many options. 39 * Retrieve all entries. It could be filtered by many options.
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php
index 298cf10c..815903fa 100644
--- a/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php
@@ -35,6 +35,7 @@ class WallabagRestControllerTest extends WallabagTestCase
35 $client = $this->createClient(); 35 $client = $this->createClient();
36 $client->request('GET', '/api/salts/admin.json'); 36 $client->request('GET', '/api/salts/admin.json');
37 $this->assertEquals(200, $client->getResponse()->getStatusCode()); 37 $this->assertEquals(200, $client->getResponse()->getStatusCode());
38 $this->assertNotEmpty(json_decode($client->getResponse()->getContent()));
38 39
39 $client->request('GET', '/api/salts/notfound.json'); 40 $client->request('GET', '/api/salts/notfound.json');
40 $this->assertEquals(404, $client->getResponse()->getStatusCode()); 41 $this->assertEquals(404, $client->getResponse()->getStatusCode());