add test for api/salts

This commit is contained in:
Nicolas Lœuillet 2015-02-10 20:07:55 +01:00
parent 68c6f1bd7f
commit f5deb024a2
2 changed files with 13 additions and 3 deletions

View File

@ -2,7 +2,6 @@
namespace Wallabag\CoreBundle\Repository;
use Doctrine\ORM\Query;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Tools\Pagination\Paginator;

View File

@ -6,7 +6,18 @@ use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class WallabagRestControllerTest extends WebTestCase
{
public function testEmptyGetEntries() {
public function testGetSalt()
{
$client = $this->createClient();
$client->request('GET', '/api/salts/admin.json');
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$client->request('GET', '/api/salts/notfound.json');
$this->assertEquals(404, $client->getResponse()->getStatusCode());
}
public function testEmptyGetEntries()
{
$client = $this->createClient();
$client->request('GET', '/api/entries');
$this->assertTrue($client->getResponse()->isOk());
@ -19,4 +30,4 @@ class WallabagRestControllerTest extends WebTestCase
);
$this->assertEquals('[]', $client->getResponse()->getContent());
}
}
}