Skip to content

Latest commit

 

History

History
50 lines (33 loc) · 1.87 KB

File metadata and controls

50 lines (33 loc) · 1.87 KB

Testing And QA

CommonPHP Notifications includes a package-local PHPUnit configuration and unit tests.

Install Dependencies

From the package directory:

composer install

From the monorepo, the root vendor directory can also satisfy the test suite because tests/bootstrap.php checks both package and workspace autoloaders.

Run PHPUnit

From the monorepo root:

vendor/bin/phpunit -c package/notifications/phpunit.xml.dist

On Windows:

vendor\bin\phpunit.bat -c package\notifications\phpunit.xml.dist

From package/notifications:

../../vendor/bin/phpunit -c phpunit.xml.dist

Current Test Coverage

The unit suite covers:

  • Recipient construction, factories, array normalization, Stringable values, metadata, channel overrides, serialization, and invalid payloads;
  • Notification construction, template factory, recipient channel filtering, copy methods, data, metadata, tags, serialization, generated ids, and invalid content;
  • DeliveryStatus, DeliveryResult, and DeliveryReport status helpers, details, serialization, filtering, iteration, counting, and exception escalation;
  • ChannelRegistry registration, defaults, replacement, removal, clearing, iteration, duplicate detection, missing channels, and invalid channel names;
  • Notifier direct sends, template sends, channel facade, multi-channel sends, channel management, missing recipients, unsupported drivers, driver exception handling, and invalid driver results;
  • ArrayNotificationDriver, NullNotificationDriver, and AbstractNotificationDriver helper behavior;
  • NotificationsServiceProvider PHP-DI wiring;
  • all package exception factories.

Manual Review Areas

Manual review should cover provider-specific driver packages, template rendering decisions, queue integration, retry policy, and operational logging in the application that consumes this package.