test: refactor StreamSocketClient tests into focused test cases#166
Open
guillaumedelre wants to merge 1 commit into
Open
test: refactor StreamSocketClient tests into focused test cases#166guillaumedelre wants to merge 1 commit into
guillaumedelre wants to merge 1 commit into
Conversation
Split the two existing test files (Tcp and Udp) into four focused test cases as described in issue bzikarsky#112: - StreamSocketClientTest: general protocol-agnostic tests extracted from the TCP file (context management, timeout, socket lifecycle, invalid constructor arguments) - StreamSocketClientTcpTest: TCP-specific data transfer tests only (write, bad write, multi-write, read, close behaviors) - StreamSocketClientUdpTest: trimmed to UDP-specific write test only, removing duplicates now covered by the general test case - StreamSocketClientSslTest: new test case covering SSL failure path (connecting with ssl:// to a plain TCP server) and SSL context preservation through the constructor Fix three pre-existing Psalm errors surfaced during this work: - Logger.php: add @param docblock for $message (string|\Stringable) without touching the PHP signature, which must stay untyped for psr/log ^1 compatibility (see bzikarsky#151) - Message.php: add explicit mixed type and @psalm-suppress on the empty() call inside the array_filter closure to preserve the existing behavior - HttpTransport.php: replace truthy check on null|string with strict null and empty-string comparisons in fromUrl() Closes bzikarsky#112 Signed-off-by: Guillaume Delre <delre.guillaume@gmail.com>
Author
|
Hey @bzikarsky, this PR fixes #112 — happy to adjust if anything looks off. |
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.
Split the two existing test files (Tcp and Udp) into four focused test cases as described in issue #112:
Fix three pre-existing Psalm errors surfaced during this work:
2.0.0incompatible withpsr/log:^1due to method signature being too strict #151)Closes #112