Skip to content

Add unit tests for data/ provider and filter classes#20784

Open
WarLikeLaux wants to merge 2 commits intoyiisoft:masterfrom
WarLikeLaux:add-data-provider-tests
Open

Add unit tests for data/ provider and filter classes#20784
WarLikeLaux wants to merge 2 commits intoyiisoft:masterfrom
WarLikeLaux:add-data-provider-tests

Conversation

@WarLikeLaux
Copy link
Contributor

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

What does this PR do?

Add and tighten tests for data/ classes: ArrayDataProvider, Sort, BaseDataProvider, DataFilter, ActiveDataFilter.

Coverage

File Tests Lines MSI
ArrayDataProvider.php 6 → 7 16/17 (94%) → 17/17 (100%) 69% → 87%
Sort.php 21 → 29 88/102 (86%) → 102/102 (100%) 95% → 97%
BaseDataProvider.php 1 → 20 5/48 (10%) → 48/48 (100%) 50% → 90%
DataFilter.php 34 → 57 147/192 (77%) → 183/192 (95%) 70% → 73%
ActiveDataFilter.php 10 → 12 45/49 (92%) → 49/49 (100%) 82% → 82%

DataFilter remaining 9 uncovered lines are in filterAttributeValue() - a protected method only called by ActiveDataFilter. Covered by ActiveDataFilterTest but not visible in per-file coverage.

Changelog not required, because no source files changed.

@codecov
Copy link

codecov bot commented Mar 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.82%. Comparing base (068c5a4) to head (af970d6).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #20784      +/-   ##
============================================
+ Coverage     78.62%   78.82%   +0.19%     
  Complexity    11566    11566              
============================================
  Files           376      376              
  Lines         30748    30748              
============================================
+ Hits          24176    24237      +61     
+ Misses         6572     6511      -61     

☔ 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