Merged
Conversation
aab1145 to
514c8a2
Compare
arnaud-23
suggested changes
Oct 25, 2016
|
|
||
| /** | ||
| * @param string $resourceName | ||
| * @param object $resourceData |
src/Gateways/VisitGateway.php
Outdated
| interface VisitGateway | ||
| { | ||
| /** | ||
| * @param integer $personId |
src/Models/Impl/VisitBuilderImpl.php
Outdated
| private $visit; | ||
|
|
||
| /** | ||
| * @return VisitBuilder |
There was a problem hiding this comment.
inheritdoc (same for the entire method of this class)
src/Repository/VisitRepository.php
Outdated
| */ | ||
| class VisitRepository implements VisitGateway | ||
| { | ||
| const RESOURCE_NAME = 'desk/people/'; |
There was a problem hiding this comment.
we don't add the last "/" for other resource name do the same here
| */ | ||
| class VisitRepositoryTest extends \PHPUnit_Framework_TestCase | ||
| { | ||
| const FROM = "2016-08-12 15:30:06"; |
| */ | ||
| public function findAllByPersonIdWithoutParameters_ReturnVisits() | ||
| { | ||
| ApiClientMock::$response = json_encode(["visits" => [new VisitStub1()], "total_count" => 1]); |
| public function findAllByPersonIdWithParameters_ReturnVisits() | ||
| { | ||
| list($from, $to) = $this->initFromAndTo(); | ||
| ApiClientMock::$response = json_encode(["visits" => [new VisitStub1()], "total_count" => 1]); |
| ApiClientMock::$response = json_encode(["visits" => [new VisitStub1()], "total_count" => 1]); | ||
|
|
||
| $visits = $this->visitRepository->findAllByPersonId(PersonStub1::ID); | ||
| $this->assertEquals(json_encode([new VisitStub1()]), json_encode($visits)); |
There was a problem hiding this comment.
what about the use of the assertVisit in VisitTestCase trait ?
| /** | ||
| * @param Visit[] $visits | ||
| */ | ||
| public function doTestVisit($visits) |
Contributor
Author
There was a problem hiding this comment.
not sure, i'm only test one visit at a time.
| */ | ||
| public function doTestVisit($visits) | ||
| { | ||
| $this->assertEquals(0, count($visits) - count(VisitGatewayMock::$visits)); |
0e50409 to
63596b3
Compare
arnaud-23
suggested changes
Oct 25, 2016
|
|
||
| $plans = $this->planRepository->findAllByPersonId(PersonStub1::ID); | ||
| $this->assertEquals(json_encode([new PlanStub1()]), json_encode($plans)); | ||
| $this->assertEquals(0, count($plans) - count(PlanGatewayMock::$plans)); |
| { | ||
| $this->planRepository = new PlanRepository(); | ||
| $this->planRepository->setApiClient(new ApiClientMock()); | ||
| PlanGatewayMock::$plans = new PlanStub1(); |
| */ | ||
| public function doTestVisits($visits) | ||
| { | ||
| $this->assertEquals(0, count($visits) - count(VisitGatewayMock::$visits)); |
| { | ||
| $this->visitRepository = new VisitRepository(); | ||
| $this->visitRepository->setApiClient(new ApiClientMock()); | ||
| VisitGatewayMock::$visits = new VisitStub1(); |
| /** | ||
| * @param Visit[] $visits | ||
| */ | ||
| public function doTestVisits($visits) |
There was a problem hiding this comment.
assertVisits and you can move it on VisitTestCase Trait
arnaud-23
suggested changes
Oct 25, 2016
| /** | ||
| * @param Visit[] $visits | ||
| */ | ||
| public function assertVisits($visits) |
There was a problem hiding this comment.
you need it in your VisitServiceImpl too
arnaud-23
approved these changes
Oct 25, 2016
43ec7cd to
d8c4ef1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.