Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Task to expand test coverage for \Drupal\Component\Utility\Unicode
.
Comment | File | Size | Author |
---|---|---|---|
#11 | unicode-phpunit-2051717-11.interdiff.txt | 513 bytes | Mile23 |
#11 | unicode-phpunit-2051717-11.patch | 5.1 KB | Mile23 |
#8 | unicode-phpunit-2051717-08.patch | 5.06 KB | Mile23 |
#8 | unicode-phpunit-2051717-08.interdiff.txt | 4.41 KB | Mile23 |
#4 | unicode-phpunit-2051717-04.patch | 7.63 KB | Mile23 |
Comments
Comment #1
jhedstromHere's a start that brings coverage from 48% to 68%. The remaining uncovered code seems to be largely dependent on specific environments from what I can tell.
Comment #2
dawehnerAs always, what a impressive amount of detail!
So which code is hard to test:
as well as large amount of substr (which maybe uses also external code if possible)
At least for substr() we can call setStatus directly, what do you think?
Comment #3
dawehnerComment #4
Mile23Added single- and multi-byte code paths to substr and strlen tests.
It'd require some refactoring to test check() and covertToUtf8() adequately, which might slow things down.
Still though... C.R.A.P. score went from 788 to 80. :-)
Comment #5
ParisLiakos CreditAttribution: ParisLiakos commentedLets also add @group Drupal too? and maybe unicode?
i can see why we static here, but maybe we should add it on #2057905: [policy, no patch] Discuss the standards for phpunit based tests so other people are aware? Right now only one provider is static in core
Comment #6
Mile23I hadn't noticed that the data providers were set static. I'm curious why that would be preferable (or not).
Comment #7
dawehnerLet's not make them static, as there is no point in doing it.
Comment #8
Mile23Took away the static.
Comment #9
dawehnerReally impressive additional test coverage!
Just in case you have to do another rerole you could add @group Drupal and @group Unicode
Comment #10
Mile23Doh!
Will add when the test comes back.
Comment #11
Mile23Added @group Drupal and Unicode.
Comment #12
webchickWow, great stuff, thanks!
Committed and pushed to 8.x.
Comment #14
jhedstrom