-
Notifications
You must be signed in to change notification settings - Fork 2
Feat/user tests #44
base: dev
Are you sure you want to change the base?
Feat/user tests #44
Commits on Feb 27, 2023
-
✨ (Get users collection) Added an advanced search for route GET /users/
Added many filters for the /users routes. User's nickname are now returned when fetching a collection of users
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for 8bb19d8 - Browse repository at this point
Copy the full SHA 8bb19d8View commit details -
🐛 (Dependency version) Updated some code to be able to be run with th…
…e current version Some code (in the filters) was outdated and not updated during the rebase
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for 6c7a6f4 - Browse repository at this point
Copy the full SHA 6c7a6f4View commit details -
⬆️ (General dependency upgrade) Many dependencies updated, some code …
…breaking changes were fixed Most notable changes are the change of the version of Symfony, ApiPlatform and PHP
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for 40622b0 - Browse repository at this point
Copy the full SHA 40622b0View commit details -
🔀 (Branch dev) Refactored changes in branch dev to work with new vers…
…ions of libraries
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for 84ea9d6 - Browse repository at this point
Copy the full SHA 84ea9d6View commit details -
🐛 (fixture) GroupSeeder was crashing when updating database
groups is a keyword in mysql, so I replaced the table name in the code (App\Entity\Group) by `groups`. Using `...` tells mysql that the content has to be evaluated, and is not a keyword
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for 9dfe858 - Browse repository at this point
Copy the full SHA 9dfe858View commit details -
Started to implement application tests on routes asso/* and user/*
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for 874f1da - Browse repository at this point
Copy the full SHA 874f1daView commit details -
✅ (tests) added tests for route GET /users
testing content of json
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for 2ab02cb - Browse repository at this point
Copy the full SHA 2ab02cbView commit details -
✅ (GET users/) Updated test structure + tested route more
Made 1 class per route. GET users/ is now more tested to verify it responds normally when something is not expected (not connected, parameter out of range, ...)
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for ee3e4b3 - Browse repository at this point
Copy the full SHA ee3e4b3View commit details -
✅ (GET users/) refactor tests structure
reafactoring tests structure. We now call directly routes, instead of calling a URL. Tests are now disconnected to each other
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for 2dd7617 - Browse repository at this point
Copy the full SHA 2dd7617View commit details -
✅ (GET /users) Enhanced tests + added EtuUTTApiTestCase
Improved GetUsers tests to make them test everything. I can't see any more major issue with this class. Now uses database calls to test API calls. Also created superclass EtuUTTApiTestCase, which should provide a lot of useful methods in the future
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for c29a3c2 - Browse repository at this point
Copy the full SHA c29a3c2View commit details -
♻️ (tests) 'test' user now saved + directory renamed
Class EtuUTTApiTestCase now saves the 'test' user, created in the setUp method. Directory tests/users was renamed to tests/Users, to be more coherent with conventions used in the project
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for ea429f6 - Browse repository at this point
Copy the full SHA ea429f6View commit details -
✅ (GET /users/{id}) Added test for route GET /users/{id}
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for 6427603 - Browse repository at this point
Copy the full SHA 6427603View commit details -
✨ (EtuUTTApiTestCase) Added createUser method
Added createUser method. The methods takes 4 parameters : $firstName, $lastName, $login and $role. Role is not mendatory. If not provided, it is defaulted to 'ROLE_USER'. It creates a user according to the parameters, put it in the database, and flush the data. In the future, if necessary, it could be useful to add a parameter to ask if we want to flush the database, because it could maybe be slow if we need to do that a lot.
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for d5089eb - Browse repository at this point
Copy the full SHA d5089ebView commit details -
✅ (PATCH /users/{id}) Started tests
testing normal call, when not connected, when the user does not exist, when no body is provided, sql injections and invalid field contents
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for 76bb314 - Browse repository at this point
Copy the full SHA 76bb314View commit details -
✅ (DELETE /users/{id}) started tests for this route
testing normal calls, when user doesn't have the permissions, when the user is not connected, when the user does not exist and verified sql injections
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for 04f644b - Browse repository at this point
Copy the full SHA 04f644bView commit details -
✅ (groups) added some tests for group + many more random things
changed version of dependency symfony/http-foundation. It's now possible to set a maximum/minimum of visible groups while seeding the Group table. lint. changed security of PATCH /groups/{slug}. Translations where not present in the group:read:one group. changed the group admin voter. Added utility functions to EtuUTTApiTestCase. updated a few tests on /users routes
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for a9922c2 - Browse repository at this point
Copy the full SHA a9922c2View commit details -
✨ (Database tests) Added a way to backup the database and check the c…
…hanges made to it it is now possible to call the backupDatabase method from the EtuUTTApiTestCase class to make a backup, and then call the assertDatabaseSameExcept method to assert the new database and the old one are the same. Expected differences can be specified in the arguments of the function
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for fe16662 - Browse repository at this point
Copy the full SHA fe16662View commit details -
✅ (GET /users) Updated tests to match new parameters of the route
Added tests for each function of the route. Removed some prints. Added assertSameUserReadSome method in EtuUTTApiTestCase. Added order in the /users routes. Fixed a problem with skip_null_values (it now seems like it's necessary to explicit that parameter for each route that overrides normalizationContext). Added a way to generate a custom amount of users in the UserSeeder. Changed phone number generation in UserInfoVisibilitySeeder. Added a parameter in BrancheFiliereFormationSeeder to set the minimum amount of users with filiere that should be generated
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for 9e1a6b0 - Browse repository at this point
Copy the full SHA 9e1a6b0View commit details -
✅ (/users routes) Added tests for parameter name. Added tests for inv…
…alid parameter values Added a test to test the parameter name. Added some tests to verify API responds correctly when an invalid value is passed to the parameters. Updated the testUEParameter test. Added parameter $flush to EtuUTTApiTestCase::createUser (defaults to false) to avoid the changes to be sent to the database (the new entity is still persisted)
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for fc185cf - Browse repository at this point
Copy the full SHA fc185cfView commit details -
🔒 (SQL injection) Fixed 2 SQL injection flaws in Filters
SearchInNamesFilter and UEFilter both contained a SQL injection flaw. It has been fixed
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for 28d8dfb - Browse repository at this point
Copy the full SHA 28d8dfbView commit details -
🐛 (Fixed tests) Fixed some errors in tests
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for 9d2e5f1 - Browse repository at this point
Copy the full SHA 9d2e5f1View commit details -
UserDataVisibilityItemDataProvider was crashing when trying to provide data to a non-authenticated user. PATCH /users/{id} didn't have the skip_null_values parameter set to false. On creation, UserInfos::$birthday was not set to a round day (it was set to the current time, not the current day)
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for bdd4c76 - Browse repository at this point
Copy the full SHA bdd4c76View commit details -
Teddy Roncin committed
Feb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for 46e20ce - Browse repository at this point
Copy the full SHA 46e20ceView commit details -
📝 (README and code) Wrote documentation
Documented new folders in the tests/ folder in the README file. Documented class EtuUTTApiTestCase (and its methods). Documented test classes
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for c31a92c - Browse repository at this point
Copy the full SHA c31a92cView commit details -
Simplified algorithm in GroupSeeder
Co-authored-by: Thomas Ritaine <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4161407 - Browse repository at this point
Copy the full SHA 4161407View commit details -
⬆️ (Faker) Replaced library fzaninotto/faker (deprecated) with librar…
…y fakerphp/faker (#38)
Configuration menu - View commit details
-
Copy full SHA for 082112b - Browse repository at this point
Copy the full SHA 082112bView commit details -
🐛 (Dependency version) Updated some code to be able to be run with th…
…e current version Some code (in the filters) was outdated and not updated during the rebase
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for 08a18f1 - Browse repository at this point
Copy the full SHA 08a18f1View commit details -
⬆️ (General dependency upgrade) Many dependencies updated, some code …
…breaking changes were fixed Most notable changes are the change of the version of Symfony, ApiPlatform and PHP
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for 2b4ae74 - Browse repository at this point
Copy the full SHA 2b4ae74View commit details -
⏪ (UserDataVisibilityItemDataProvider) Removed a seemingly useless ch…
…ange in UserDataVisibilityItemDataProvider
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for 265781b - Browse repository at this point
Copy the full SHA 265781bView commit details -
🐛 (GroupAdminVoter) Added a check for the type of $subject in the sup…
…ports method
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for f5c8596 - Browse repository at this point
Copy the full SHA f5c8596View commit details -
🐛 (PATCH /groups/{id} - security) object (the group to modify) was no…
…t passed to the voter
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for 262c87b - Browse repository at this point
Copy the full SHA 262c87bView commit details -
🐛 (DELETE /groups/{id} - Security) The changes of the new GroupAdminV…
…oter was not applied here
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for c6993e3 - Browse repository at this point
Copy the full SHA c6993e3View commit details -
🔧 (.gitignore) Removed section "Old stuff" from .gitignore
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for e79a2f0 - Browse repository at this point
Copy the full SHA e79a2f0View commit details -
🏷️ (Group entity) All rates were integers, replaced them with floats
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for 8f4763e - Browse repository at this point
Copy the full SHA 8f4763eView commit details -
✨ (Helper method in EtuUTTApiTestCase) Added an helper method in EtuU…
…TTApiTestCase to create a new client
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for 29f9e06 - Browse repository at this point
Copy the full SHA 29f9e06View commit details -
⏪ (Splitting branch) Removed folders test/Groups and test/Users
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for 490a314 - Browse repository at this point
Copy the full SHA 490a314View commit details -
⏪ (Splitting branch) Removed features that should not be in this PR
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for aee95f6 - Browse repository at this point
Copy the full SHA aee95f6View commit details -
✅ (Moving changes) Added folder test/Users/
Teddy Roncin committedFeb 27, 2023 Configuration menu - View commit details
-
Copy full SHA for 8fa21db - Browse repository at this point
Copy the full SHA 8fa21dbView commit details