From 0d3043a29c4aba541d6a18c2d5cc7ebffc6ddc78 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 15 Mar 2016 18:50:13 +0100 Subject: [PATCH] fix api properties and typo --- src/Wallabag/ApiBundle/Controller/WallabagRestController.php | 4 ++-- .../ApiBundle/Tests/Controller/WallabagRestControllerTest.php | 4 ++-- src/Wallabag/CoreBundle/Controller/DeveloperController.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php index 2633a311..3265ba38 100644 --- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php @@ -126,11 +126,11 @@ class WallabagRestController extends FOSRestController $this->get('wallabag_core.content_proxy')->assignTagsToEntry($entry, $tags); } - if (true === (bool) $isStarred) { + if ($isStarred === 'true') { $entry->setStarred(true); } - if (true === (bool) $isArchived) { + if ($isArchived === 'true') { $entry->setArchived(true); } diff --git a/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php b/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php index 2e78d8b2..f5a9748c 100644 --- a/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php +++ b/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php @@ -188,8 +188,8 @@ class WallabagRestControllerTest extends WallabagApiTestCase { $this->client->request('POST', '/api/entries.json', array( 'url' => 'http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', - 'archive' => true, - 'starred' => true, + 'archive' => 'true', + 'starred' => 'true', )); $this->assertEquals(200, $this->client->getResponse()->getStatusCode()); diff --git a/src/Wallabag/CoreBundle/Controller/DeveloperController.php b/src/Wallabag/CoreBundle/Controller/DeveloperController.php index f519bdbc..e5cfd83c 100644 --- a/src/Wallabag/CoreBundle/Controller/DeveloperController.php +++ b/src/Wallabag/CoreBundle/Controller/DeveloperController.php @@ -43,7 +43,7 @@ class DeveloperController extends Controller $clientForm->handleRequest($request); if ($clientForm->isValid()) { - $client->setAllowedGrantTypes(array('token', 'authorization_code', 'password','refresh_token')); + $client->setAllowedGrantTypes(array('token', 'authorization_code', 'password', 'refresh_token')); $em->persist($client); $em->flush(); -- 2.41.0