forked from wallabag/wallabag
add test for empty salt
This commit is contained in:
@ -33,7 +33,7 @@ class WallabagRestController extends Controller
|
|||||||
throw $this->createNotFoundException();
|
throw $this->createNotFoundException();
|
||||||
}
|
}
|
||||||
|
|
||||||
return array($user->getSalt());
|
return array($user->getSalt() ?: null);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Retrieve all entries. It could be filtered by many options.
|
* Retrieve all entries. It could be filtered by many options.
|
||||||
|
|||||||
@ -35,6 +35,7 @@ class WallabagRestControllerTest extends WallabagTestCase
|
|||||||
$client = $this->createClient();
|
$client = $this->createClient();
|
||||||
$client->request('GET', '/api/salts/admin.json');
|
$client->request('GET', '/api/salts/admin.json');
|
||||||
$this->assertEquals(200, $client->getResponse()->getStatusCode());
|
$this->assertEquals(200, $client->getResponse()->getStatusCode());
|
||||||
|
$this->assertNotEmpty(json_decode($client->getResponse()->getContent()));
|
||||||
|
|
||||||
$client->request('GET', '/api/salts/notfound.json');
|
$client->request('GET', '/api/salts/notfound.json');
|
||||||
$this->assertEquals(404, $client->getResponse()->getStatusCode());
|
$this->assertEquals(404, $client->getResponse()->getStatusCode());
|
||||||
|
|||||||
Reference in New Issue
Block a user