From: Thomas Citharel Date: Tue, 15 Mar 2016 17:50:13 +0000 (+0100) Subject: fix api properties and typo X-Git-Tag: 2.0.0~22^2~4 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=0d3043a29c4aba541d6a18c2d5cc7ebffc6ddc78;p=github%2Fwallabag%2Fwallabag.git fix api properties and typo --- 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();