Skip to content

Add unit tests for PhpMessageSource#20776

Open
WarLikeLaux wants to merge 2 commits intoyiisoft:masterfrom
WarLikeLaux:test-i18n-php-message-source
Open

Add unit tests for PhpMessageSource#20776
WarLikeLaux wants to merge 2 commits intoyiisoft:masterfrom
WarLikeLaux:test-i18n-php-message-source

Conversation

@WarLikeLaux
Copy link
Contributor

Q A
Is bugfix?
New feature?
Breaks BC?
Fixed issues

What does this PR do?

Add unit tests for PhpMessageSource: getMessageFilePath with fileMap, fallback chain (en-USen), and loadFallbackMessages merge logic.

Before / After

File Tests Methods Lines MSI
PhpMessageSource.php 0 → 26 0/4 → 4/4 0/39 (0%) → 39/39 (100%) — → 91% (67/73)

Escaped mutants (all equivalent)

PhpMessageSource.php (6): ProtectedVisibility ×3 - L103, L135, L157, always equivalent. CastString ×2 - L76, L137, defensive cast on already-typed parameter. CastArray ×1 - L125, caller loadMessages applies (array) on the return value.

Changelog not required, because no source files changed.

@codecov
Copy link

codecov bot commented Mar 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.57%. Comparing base (379b296) to head (8f76f1a).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##             master   #20776   +/-   ##
=========================================
  Coverage     78.56%   78.57%           
  Complexity    11568    11568           
=========================================
  Files           376      376           
  Lines         30750    30750           
=========================================
+ Hits          24160    24162    +2     
+ Misses         6590     6588    -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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