Repository navigation
Update test suite to ensure 100% code coverage - #29
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The coverage gate can succeed without a valid coverage report, undermining its enforcement.
1 open issue
What changed in this PR
This PR expands test coverage for the multicast socket factory and adds a CI gate intended to enforce 100% coverage, excluding legacy PHP 5.3.
Changes:
- Add tests for socket creation failures and use a dynamically selected port in the invalid-address test.
- Remove redundant
SO_REUSEADDRconfiguration and adjust coverage exclusions. - Generate and check Clover coverage reports, with a README badge and local reporting instructions.
| File | Description |
|---|---|
| tests/FunctionalTest.php | Add failure-path tests and replace a fixed test port. |
| src/Factory.php | Simplify socket setup and annotate unsupported-environment branches. |
| README.md | Document coverage expectations and report generation. |
| .github/workflows/ci.yml | Generate Clover reports and enforce full coverage on PHP 5.4+. |
Review effort: Balanced
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.

This changeset updates the test suite to ensure 100% code coverage.
The coverage check skips legacy PHP 5.3, as
createReceiver()requires PHP 5.4+ and can not be covered there. This also removes the explicitSO_REUSEADDRsocket option, as PHP already sets this for all stream sockets, so multiple receivers can still share the same port.Builds on top of #28, #27 and clue/reactphp-eventsource#35
Refs reactphp/socket#236