-
-
Notifications
You must be signed in to change notification settings - Fork 27
Added new endpoint, fix and added tests. #41
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
Added new endpoint, fix and added tests. #41
Conversation
…cy/Client into added-project-and-workspace
…cy/Client into added-project-and-workspace
This PR seems to still be based off of 2.1 and not 3.0. |
…rkspace # Conflicts: # composer.json
Apply fixes from StyleCI
Apply fixes from StyleCI
I've added some examples to the README now, including how to use the paginator, which is why those |
@GrahamCampbell thank you for all the feedbacks. We will fix them soon. What do you think about test system? Can we add more test (like we have already did in this PR)? |
The tests are great. In fact, I might take over the |
Ok, I've finished rigorously replacing teams/users stuff with workspaces: 2.1...3.0. I've also removed any deprecated endpoints. I just have left to go through the repositories endpoints to see if there's anything new they've added we don't yet support. If you could rebase this PR, just providing the tests, that would be great. I'll then given them a review and we hopefully can merge this PR. :) |
…rkspace # Conflicts: # src/Api/Repositories.php # src/Api/Repositories/Workspaces.php # src/Api/Repositories/Workspaces/AbstractWorkspacesApi.php # src/Api/Teams/Repositories.php # src/Api/Workspaces.php
Apply fixes from StyleCI
Thanks for the PR. I'll finish off here, and merge locally. :) |
* | ||
* @author Graham Campbell <graham@alt-three.com> | ||
*/ | ||
class Repositories extends AbstractWorkspacesApi |
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.
Please delete this. There is no such API.
* | ||
* @return array | ||
*/ | ||
public function list(array $params = []) |
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.
Please delete this. This is already implemented on the "CurrentUser" API.
@@ -71,7 +71,7 @@ public function show(string $project, array $params = []) | |||
* | |||
* @return array | |||
*/ | |||
public function update(string $project, array $params = []) |
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.
Please don't change this. We have params like this out of convention. If we want to review that, we'd want to do it for all cases, not just one, and not in this PR.
@@ -104,6 +104,6 @@ public function remove(string $project, array $params = []) | |||
*/ | |||
protected function buildProjectsPath(string ...$parts) | |||
{ | |||
return static::buildPath('workspaces', $this->username, 'projects', ...$parts); |
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.
This typo, and a few others are already fixed on 3.0
.
use Http\Message\ResponseFactory; | ||
use Psr\Http\Message\ResponseInterface; | ||
|
||
class ProjectsAllResponse extends BaseResponse implements ResponseFactory |
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.
Wrong to implement this interface, when you then disregard the parameters.
Replaces #41. Co-Authored-By: Giacomo Fabbian <info@giacomofabbian.it> Co-Authored-By: SanaviaNicolas <sanavianicolas@users.noreply.github.com>
Hi @GrahamCampbell , I have just seen the new PR. Good job! |
I don't think getting 100% code coverage with that style of test is really going to add much value. It was certainly good to have a small number of those tests though, like you added, so thanks for that. Those sorts of tests don't catch mistakes URLs generated by the code, which is the most common error, I think. |
Can you give me an example of "mistakes URLs generated by the code"? |
The only way to catch those sorts of errors, is to actually hit the API, like in https://github.com/BitbucketAPI/Client/blob/46bf30101114dae032ed381642e91c2ba1e1a51a/tests/ClientTest.php#L35-L47. But, obviously our tests are going to be quite slow if we do this for all the endpoints. Anyway, I don't think we should. I think we have enough coverage from people using the code and letting us know. One place where I think we could have better test coverage is the http plugins, however. |
WORKSPACES
PROJECTS
REPOSITORIES
TESTS