Skip to content

test: cover exception narrowing behavior#34

Merged
simPod merged 3 commits into
masterfrom
test/exception-behavior-coverage
Jun 22, 2026
Merged

test: cover exception narrowing behavior#34
simPod merged 3 commits into
masterfrom
test/exception-behavior-coverage

Conversation

@simPod

@simPod simPod commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Summary

Adds behavior-level PHPStan assertions for exception narrowing in both Brick extension packages.

The tests pair positive and negative cases so regressions are visible when an exception is incorrectly removed or stops being removed.

Money coverage includes:

  • factory methods: number format, unknown currency, and rounding exceptions
  • arithmetic and comparison methods: parsing, rounding, division-by-zero, currency/context mismatch residuals
  • conversion methods: unknown currency, number format, invalid exchange rate, and rounding residuals
  • MoneyBag and CurrencyConverter currency handling

Math coverage includes:

  • factory methods: parsing and division-by-zero residuals
  • conversion methods: no-op conversions, integer overflow, and rounding residuals
  • operation methods: parsing, division-by-zero, and residual operation exceptions
  • rounding-mode methods: rounding, invalid scale, and negative-number residuals

@simPod simPod changed the title test(money): cover exception narrowing behavior test: cover exception narrowing behavior Jun 22, 2026
@simPod simPod merged commit 0bd927f into master Jun 22, 2026
@simPod simPod deleted the test/exception-behavior-coverage branch June 22, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant