Skip to content

Add unit tests for cache dependencies#20775

Open
WarLikeLaux wants to merge 3 commits intoyiisoft:masterfrom
WarLikeLaux:test-cache-dependencies
Open

Add unit tests for cache dependencies#20775
WarLikeLaux wants to merge 3 commits intoyiisoft:masterfrom
WarLikeLaux:test-cache-dependencies

Conversation

@WarLikeLaux
Copy link
Contributor

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

What does this PR do?

Add unit tests for ChainedDependency, ExpressionDependency, and DummyCache.

Before / After

File Tests Methods Lines MSI
ChainedDependency.php 0 → 15 0/3 → 2/3 0/9 (0%) → 8/9 (89%) — → 100% (18/18)
ExpressionDependency.php 0 → 13 0/1 → 1/1 0/1 (0%) → 1/1 (100%) — → 100% (1/1)
DummyCache.php 0 → 18 0/5 → 5/5 0/5 (0%) → 5/5 (100%) — → 100% (10/10)

46 tests, 70 assertions total.

ChainedDependency uncovered line 58: generateDependencyData() returns null. Dead code - the method is never called because ChainedDependency overrides both evaluateDependency() and isChanged(). Exists only to satisfy the abstract contract from Dependency.

Changelog not required, because no source files changed.

@WarLikeLaux WarLikeLaux changed the title Test cache dependencies Add unit tests for cache dependencies Mar 4, 2026
@codecov
Copy link

codecov bot commented Mar 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.21%. Comparing base (37b6e7b) to head (dd4d201).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #20775      +/-   ##
============================================
+ Coverage     80.13%   80.21%   +0.07%     
  Complexity    11533    11533              
============================================
  Files           374      374              
  Lines         30206    30206              
============================================
+ Hits          24207    24230      +23     
+ Misses         5999     5976      -23     

☔ 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