]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
add test for empty salt
authorNicolas Lœuillet <nicolas@loeuillet.org>
Wed, 11 Feb 2015 14:15:06 +0000 (15:15 +0100)
committerNicolas Lœuillet <nicolas@loeuillet.org>
Wed, 11 Feb 2015 14:15:06 +0000 (15:15 +0100)
src/Wallabag/CoreBundle/Controller/WallabagRestController.php
src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php

index 3cfb8a77803920eb7771cf9ca7427567fc2b19dd..e9cd8c93922da75efa0d4b93f0e6822d85d7dc21 100644 (file)
@@ -33,7 +33,7 @@ class WallabagRestController extends Controller
             throw $this->createNotFoundException();
         }
 
-        return array($user->getSalt());
+        return array($user->getSalt() ?: null);
     }
     /**
      * Retrieve all entries. It could be filtered by many options.
index 298cf10c137a0fff73013a99c111759558acd5f7..815903fad6a759f14fcb619f3785122da824604c 100644 (file)
@@ -35,6 +35,7 @@ class WallabagRestControllerTest extends WallabagTestCase
         $client = $this->createClient();
         $client->request('GET', '/api/salts/admin.json');
         $this->assertEquals(200, $client->getResponse()->getStatusCode());
+        $this->assertNotEmpty(json_decode($client->getResponse()->getContent()));
 
         $client->request('GET', '/api/salts/notfound.json');
         $this->assertEquals(404, $client->getResponse()->getStatusCode());