-
Notifications
You must be signed in to change notification settings - Fork 417
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(default_group): exposed deafult_group in /users/self #2209
fix(default_group): exposed deafult_group in /users/self #2209
Conversation
I am not sure how to write tests for the changed function, so if anyone can suggest the required changes that would be great. |
Hey @pret3nti0u5 , You need to modify
You need to create an object of UserDao in fossology/src/www/ui_tests/api/Controllers/UploadControllerTest.php Lines 165 to 166 in a3c9346
And then add following lines to function before creating $user[0]["default_group"] = "fossy";
$this->userDao->shouldReceive('getUserAndDefaultGroupByUserName')->withArgs([$user[0]["name"])
->andReturn(["group_name" => "fossy"]); |
cb185e4
to
7513038
Compare
@GMishx Guess this should work. Let me know if any changes are required. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes looks good.
@pret3nti0u5 can you please squash the commits? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested, working as expected.
fix(default_group): Removed whitespace to fix codesniffer warning fix(default_group): Added tests for UserController.php
7513038
to
41cd3d4
Compare
Done. |
Description
Exposed
default_group
in endpoint/api/v1/users/self
. Closes #2208. This in regards to the discussion I and @GMishx had on thread #199.Changes
Edited
UserController.php
for exposing key andopenapi.yaml
for updating documentation.How to test
Send GET request to endpoint
/api/v1/users/self
Closes #2208
Closes #2054