Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Not enough coverage for Drupal\Component\Plugin
.
ReflectionFactory
has a CRAP score of 110, which means it's a project risk within its namespace.
Along with the others in #2052109: [meta] Expand phpunit tests for \Drupal\Component\Plugin classes it should be unit tested.
Proposed resolution
Write some tests.
Make a patch.
Commit the patch.
Remaining tasks
User interface changes
API changes
Beta phase evaluation
Unfrozen changes | Unfrozen because it only improves automated testing. |
---|
Comment | File | Size | Author |
---|---|---|---|
#3 | interdiff.txt | 2.26 KB | Mile23 |
#3 | 2375737_3.patch | 7.32 KB | Mile23 |
#1 | 2375737_1.patch | 6.68 KB | Mile23 |
Comments
Comment #1
Mile23A patch. Covers ReflectionFactory 100%, reduced CRAP score to 10.
Comment #2
DuaelFr12/12 tests PASS
100% coverage !
Good job :)
But...
Missing tiny docblocks? :p
Comment #3
Mile23Thanks!
Added docblocks. Also changed the docblock for
StubReflectionFactory
just a little, and also the return line ofgetPluginClass()
.Also added beta evaluation.
Comment #4
DuaelFrI don't think we absolutely need docblocks on the empty constructors for your stub classes so, let's RTBC.
Good job.
Comment #6
Mile23Not really sure why the test fails, especially with just 'Terminated' written over and over in the log.
The tests added here all pass locally, so I'm re-queuing.
Comment #8
Mile23Testbot is happy again.
Comment #9
daffie CreditAttribution: daffie commentedIt was RTBC before the failed retest and nothing has changed, so back to RTBC.
Comment #10
webchickNot really the most qualified to give these sign-off, but they've been sitting here long enough for someone to raise objections, and moar test coverage is never a bad thing.
Committed and pushed to 8.0.x. Thanks!