feat: Refactor http client mock#86
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #86 +/- ##
=============================================
+ Coverage 52.04% 69.29% +17.24%
- Complexity 537 757 +220
=============================================
Files 34 61 +27
Lines 1587 2273 +686
=============================================
+ Hits 826 1575 +749
+ Misses 761 698 -63
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
91bd54d to
546dee4
Compare
| public function __toString(): string | ||
| { | ||
| return is_callable($this->method) | ||
| ? 'callback(request.header) !== false' |
There was a problem hiding this comment.
request.method instead of request.header
|
|
||
| public function __construct(string $key, private mixed $value) | ||
| { | ||
| $this->key = strtolower($key); |
There was a problem hiding this comment.
Why is request param key lowercased, but query param key not?
src/HttpClientMock/RealRequest.php
Outdated
|
|
||
| public function hasHeader(string $key): bool | ||
| { | ||
| return in_array($key, array_map('strtolower', array_keys($this->headers))); |
There was a problem hiding this comment.
It may be more error safe to normalize header keys in the constructor so that they cannot be forgotten.
There was a problem hiding this comment.
done. only did it this way so the RealRequest toString call would print the headers in the same way they were provided. but it's safer this way.
546dee4 to
067c61a
Compare
c7e51c2 to
8125287
Compare
BREAKING CHANGE: Request matcher behaviour has changed for headers, queryParams, requestParams and multiparts
8125287 to
6344030
Compare
|
🎉 This PR is included in version 7.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
No description provided.