From f5deb024a2dd5a2cb27263a51f4653609407597e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 10 Feb 2015 20:07:55 +0100 Subject: add test for api/salts --- src/Wallabag/CoreBundle/Repository/EntryRepository.php | 1 - .../Tests/Controller/WallabagRestControllerTest.php | 15 +++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'src/Wallabag/CoreBundle') diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index b6f86707..bedc90d2 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -2,7 +2,6 @@ namespace Wallabag\CoreBundle\Repository; -use Doctrine\ORM\Query; use Doctrine\ORM\EntityRepository; use Doctrine\ORM\Tools\Pagination\Paginator; diff --git a/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php index 0949b92d..d9e6a161 100644 --- a/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php @@ -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()); } -} \ No newline at end of file +} -- cgit v1.2.3