aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/ApiBundle/Controller
Commit message (Collapse)AuthorAgeFilesLines
* api/entries: add parameter detail to exclude or include content in responseKevin Decherf2019-05-181-0/+21
| | | | | | | | | | | | detail=metadata will nullify the content field of entries in order to make smaller responses. detail=full keeps the former behavior, it sends the content of entries. It's the default, for backward compatibility. Fixes #2817 Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
* Some cleanupJeremy Benoist2019-04-011-0/+18
| | | | Also, do not run the hashed_url migration into a Doctrine migration
* Use a better index for hashed_urlJeremy Benoist2019-04-011-12/+12
| | | | | | It'll most often be used in addition to the `user_id`. Also, automatically generate the hash when saving the url. Switch from `md5` to `sha1`.
* Keep url in exists endpointJeremy Benoist2019-04-011-39/+36
| | | | | | - Add migration - Use md5 instead of sha512 (we don't need security here, just a hash) - Update tests
* Hash the urls to check if they existThomas Citharel2019-04-011-2/+53
| | | | Signed-off-by: Thomas Citharel <tcit@tcit.fr>
* Merge remote-tracking branch 'origin/master' into 2.4Jeremy Benoist2019-04-011-13/+55
|\
| * tests: fix broken session clients for rest entry deletion testsKevin Decherf2019-02-201-4/+13
| | | | | | | | Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
| * EntryRestController: add support of expect parameter to delete actionKevin Decherf2019-02-201-5/+16
| | | | | | | | | | | | | | | | | | | | | | The expect parameter enables an application to request the whole entry or only the id when requesting its deletion. `expects` defaults to `entry` to prevent any API breakage. Fixes #3711 Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
| * tests: create entry for testDeleteEntry, fix missing idKevin Decherf2019-02-171-7/+29
| | | | | | | | | | | | | | | | | | | | | | When using the entity manager to retrieve an already stored entry, the id disapears from $entry after the first delete call. This leads to testing a nonexistent endpoint (api/entries/.json) during the second delete call. This change now creates an entry specifically for the test. Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
* | Factorize sendResponse between Api controllersJeremy Benoist2019-01-221-3/+2
| | | | | | | | And run newer cs fixer
* | [wallabag/wallabag#2611] Fix PHPCS lint errorsCraig Roberts2019-01-221-5/+2
| |
* | Fixes [wallabag/wallabag#2611] Add a basic Search REST endpointCraig Roberts2019-01-221-0/+73
| | | | | | | | | | | | | | - Adds a new `search` key to `src/Wallabag/ApiBundle/Resources/config/routing_rest.yml` - Reuses the `getBuilderForSearchByUser` method from the EntryRepository - Supports, `term`, `page`, and `perPage` query parameters - Some very basic tests
* | Enable PHPStanJeremy Benoist2019-01-181-2/+2
| | | | | | | | | | - Fix error for level 0 & 1 (level 7 has 699 errors...) - Add `updated_at` to site_credential (so the `timestamps()` method applies correctly)
* | Add a new endpoint to retrieve information from the wallabag instanceJeremy Benoist2019-01-151-0/+17
| | | | | | | | | | | | | | Useful for api client which required some information. We might add more inside them in the future. The endpoint /api/version should be avoided now as it contains not so much information rather the version.
* | Merge remote-tracking branch 'origin/master' into 2.4Jeremy Benoist2019-01-153-2/+67
|\|
| * Avoid error when a bad `order` parameter is givenJeremy Benoist2019-01-141-0/+9
| | | | | | | | Only allowed parameter are asc & desc
| * Merge pull request #3831 from wallabag/fix/api-bad-client-idJérémy Benoist2019-01-101-0/+14
| |\ | | | | | | Cast client id to avoid PG error
| | * Cast client id to avoid PG errorJeremy Benoist2019-01-091-0/+14
| | | | | | | | | | | | If someone send a malformated client_id when trying to authenticate using the API we got a 500 if wallabag use postgres because the request send a string instead of an integer.
| * | TagRestController: fix test for tag without entriesKevin Decherf2018-12-301-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | As the deletion now requires that at least one entry for the user must be linked to the given tag, we fix the test testDeleteUserTag by linking it to an entry. Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
| * | TagRestController: add tests to ensure that other user's tags are unreachableKevin Decherf2018-12-301-0/+32
| |/ | | | | | | Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
* | CSJeremy Benoist2018-11-281-1/+1
| |
* | Fix testsJeremy Benoist2018-11-281-44/+40
| |
* | Jump to Symfony 3.4Jeremy Benoist2018-10-041-1/+1
| | | | | | | | | | | | | | Thanks to the BC compatibility, almost nothing have to be changed. All changes are related to new bundle version of: - SensioFrameworkExtraBundle - DoctrineFixturesBundle
* | Entry: add archived_at property and updateArchived methodSébastien Viande2018-09-211-0/+2
|/
* php-cs-fixerKevin Decherf2018-09-052-17/+17
| | | | Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
* Fix testsJeremy Benoist2018-06-061-17/+17
|
* Fixed testsNicolas Lœuillet2018-01-121-1/+1
|
* api: copy entry object before sending, to keep idKevin Decherf2017-12-171-0/+1
| | | | | | Workaround for https://github.com/wallabag/android-app/issues/646 Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
* Fix empty title and domain_name when exception is thrown during fetchKevin Decherf2017-12-131-0/+2
| | | | | | | | | | Add a new helper to set a default title when it's empty: 1/ use basename part of entry's path, if any 2/ or use domain name Fixes #2053 Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
* CSJeremy Benoist2017-11-211-1/+1
|
* Fix phpcsKevin Decherf2017-11-191-17/+17
| | | | Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
* Improve EntryRestControllerTest for origin_urlKevin Decherf2017-11-191-0/+55
| | | | | | | | Ensure that origin_url is initially null Ensure patching entry with origin_url='' Ensure patching entry with origin_url=null Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
* Add some tests for OriginUrl in EntryRestControllerKevin Decherf2017-11-191-0/+73
| | | | Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
* CSJeremy Benoist2017-10-121-1/+1
|
* Fix #3361 add testSébastien Viande2017-10-121-0/+7
|
* Multiple tag search was broken from APIJeremy Benoist2017-09-061-0/+3
| | | | | | | | | | First, the setParameter() were done on the same parameter which in fact just duplicated the condition in the SQL query (like `where t.label = 'test' and t.label = 'test'`. Changed the parameter doesn't help because the query was then wrong. Changing the way to match associated tags for an entry and it worked.
* Set a starred_at field when an entry is starred.François D2017-08-251-0/+5
| | | | | | | | This date is used to sort starred entries. Can not use Entry::timestamps method otherwise starred_at will be updated each time entry is updated. Add an updateStar method into Entry class A migration script has been added in order to set starred_at field.
* Add a test for updatePublishedAtJeremy Benoist2017-07-241-0/+34
| | | | | | | To avoid error when a content is re-submitted and it previously add a published date. Also, fix the `testPostSameEntry`
* Revert client_credentials grant typesJeremy Benoist2017-07-081-21/+1
|
* CSJeremy Benoist2017-07-031-15/+14
|
* Fix PATCH methodJeremy Benoist2017-07-031-10/+58
| | | | | The PATCH method for the entry should only update what user sent to us and not the whole entry as it was before. Also, sending tags when patching an entry will now remove all current tags & assocatied new ones.
* Fix testsJeremy Benoist2017-07-031-12/+12
|
* Add a real configuration for CS-FixerJeremy Benoist2017-07-015-208/+208
|
* Return null instead of falseJeremy Benoist2017-06-281-3/+3
|
* Avoid BC on exists endpointJeremy Benoist2017-06-231-4/+37
|
* Add client_credentials oAuth2 auth methodThomas Citharel2017-06-141-3/+24
| | | | Signed-off-by: Thomas Citharel <tcit@tcit.fr>
* Add public filter/field in the APIJeremy Benoist2017-06-101-0/+52
| | | | | | Listing entries can now be filtered by “public”. Creating or patching an entry can now set is to public or remove the public. Entry response now include “is_public” boolean field
* Fix testJeremy Benoist2017-06-081-4/+4
| | | | | de_DE is not valid language. Zataz doesn’t send a valid language in their content (they use `fr-FR`).
* Add ability to name the clientJeremy Benoist2017-06-081-1/+2
|
* Create a client when creating a user using the apiJeremy Benoist2017-06-071-0/+12
| | | | | | | | While creating a new user using the API, we also create a new client for the current user. So the app which just create the user can use its newly created client to configure the app. That new client is only return after creating the user. When calling the endpoint /api/user to get user information, the new client information won’t be return.