Skip to content

Improve test coverage - #101

Merged
dru1x merged 11 commits into
mainfrom
improve-test-coverage
Sep 4, 2026
Merged

Improve test coverage#101
dru1x merged 11 commits into
mainfrom
improve-test-coverage

Conversation

@dru1x

@dru1x dru1x commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Summary

Closes out the remaining test-coverage gaps and adds a coverage floor enforced in CI, so future regressions in coverage are caught automatically instead of silently.

Changes

  • Added an ericsizemore/phpunit-coverage-check-action step to .github/workflows/test.yml, enforcing a 100% coverage threshold (checked once, on PHP 8.2) against a generated coverage.xml clover report.
  • Corrected the test-coverage composer script (dropped a stray coverage argument being passed to --coverage-text).
  • Corrected the PHP extensions installed for the test workflow (zipzlib) and fixed XDEBUG_MODE=coverage so coverage is actually collected in CI.
  • Moved SuccessfulPushReceiptTest into its correct namespace.

Testing

  • Added tests/Unit/Support/CollectionTest.php covering CollectionMethods::doesntContain().
  • Added tests/Unit/PushToken/PushTokenCollectionTest.php covering PushTokenCollection::shift().
  • Added coverage in tests/Unit/Request/GetReceiptsRequestTest.php for the remaining PushReceiptErrorCode cases.
  • Added a feature test in tests/Feature/SendNotificationsTest.php for the invalid-credentials (PushErrorCode::Unauthorized) response.
  • Added tests/Unit/PushMessage/PushMessageTest.php covering PushMessage::fromArray()'s invalid recipient, priority, and interruptionLevel branches.

Related Issues

@dru1x
dru1x marked this pull request as draft August 21, 2026 00:03
@dru1x dru1x changed the title Prepare v1.0.0 release Improve test coverage Aug 21, 2026
@dru1x
dru1x force-pushed the improve-test-coverage branch from 08fdc29 to 8b8aa26 Compare August 25, 2026 23:20
@dru1x dru1x added the testing Testing and coverage tasks label Aug 26, 2026
@dru1x
dru1x marked this pull request as ready for review August 26, 2026 08:53
@dru1x
dru1x requested a review from liamduckett August 26, 2026 08:53
@dru1x dru1x self-assigned this Aug 27, 2026
Comment thread tests/Unit/PushMessage/PushMessageTest.php
@dru1x
dru1x merged commit 0aef4c7 into main Sep 4, 2026
7 checks passed
@dru1x
dru1x deleted the improve-test-coverage branch September 4, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment