Fix integration tests#10
Conversation
|
I have fixed all possible errors and failures in integration test. Last thing I cant fix is enable courier in sandbox account, so 5 tests didn't pass. |
|
@snapshotpl You need to write to InPost support and ask them to enable courier on your Sandbox account. That's how I did. Thanks for the fixes, I'll review them in free time. The Sandbox is unfortunately pretty unstable 😔. |
michalbiarda
left a comment
There was a problem hiding this comment.
Could you please answer my question in review and refactor one of your fixes? I'll try to check later the last issue.
| if (!$response->getSuccess()) { | ||
| $this->debug(print_r($response->getPayload()->toArray(), true)); | ||
|
|
||
| if ($response->getPayload()->status === 500) { |
There was a problem hiding this comment.
@snapshotpl In what cases did you encounter 500 errors?
There was a problem hiding this comment.
There was a problem hiding this comment.
Do you encounter this 500 error every time you perform a request? I have never had issues with this one, nor do I have it now...
I would rather not skip test because of 500 error. Such mechanism might hide some real issues in the future.
| 'message' => $data['error'] | ||
| 'status' => $data['status'] ?? $httpResponse->getStatusCode(), | ||
| 'error' => $data['key'] ?? '', | ||
| 'message' => $data['error'] ?? '', |
There was a problem hiding this comment.
@snapshotpl This three lines of changes are unnecessary. Existence of status, key and error is already checked in if condition.
| 'message' => $data['error'] | ||
| 'status' => $data['status'] ?? $httpResponse->getStatusCode(), | ||
| 'error' => $data['key'] ?? '', | ||
| 'message' => $data['error'] ?? '', |
There was a problem hiding this comment.
@snapshotpl These three lines of changes are unnecessary. Existence of status, error and message is already checked in if condition.
| } | ||
| return null; | ||
| } | ||
| $data['status'] ??= $httpResponse->getStatusCode(); |
| } | ||
| $data['status'] ??= $httpResponse->getStatusCode(); | ||
| $data['error'] = $data['key'] ?? ''; | ||
| $data['message'] = $data['error'] ?? ''; |
There was a problem hiding this comment.
@snapshotpl The default (documented) error response has status, error, message and (optional) details. Please fill in message with error and error with key only if message doesn't exist.
I know the whole thing is stupid, but inconsistency of Inpost API is even more stupid 👎.
| if (!$response->getSuccess()) { | ||
| $this->debug(print_r($response->getPayload()->toArray(), true)); | ||
|
|
||
| if ($response->getPayload()->status === 500) { |
There was a problem hiding this comment.
Do you encounter this 500 error every time you perform a request? I have never had issues with this one, nor do I have it now...
I would rather not skip test because of 500 error. Such mechanism might hide some real issues in the future.
|
@snapshotpl When you're done with your work, please create a merge request to |
|
After enable courier on my sandbox account only one test fails: |
|
@michalbiarda ping :-) |
|
@michalbiarda Can I help somehow with this release? |
|
@snapshotpl Unfortunately I have to abandon this project due to lack of time for development / maintenance :-(. I'm sorry. |
|
@michalbiarda understand. Can I take this code and move forward my own namespace? |
|
@snapshotpl Please do whatever you want with the code. Just put a link to this repo in your readme and mention me there. Hope you'll have time to finish it and maintain it. There's not much left I think :-). |
No description provided.