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
In #2022931: Move drupal_var_export() to \Drupal\Component\Utility the Variable static class was created.
In #2002514: Deprecate debug(); remove references to _drupal_debug_message()., due to scope change, the unit tests were never written.
Proposed resolution
Write the tests.
Remaining tasks
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#14 | interdiff.txt | 1 KB | Mile23 |
#14 | 2163245_14.patch | 2.69 KB | Mile23 |
#12 | interdiff.txt | 2.06 KB | Mile23 |
#12 | 2163245_12.patch | 2.49 KB | Mile23 |
#9 | 2163245_9.patch | 2.83 KB | Mile23 |
Comments
Comment #1
Mile23Le Patch.
Note that this test results in 100% code coverage, even though it shouldn't.
The bit at the end of Variable::export() that adds the prefix is always run, due to the way the $prefix default is set.
It should either set $prefix to NULL, or just always run str_replace() which is what's happening anyway.
Comment #2
ParisLiakos CreditAttribution: ParisLiakos commentedlooks good, thanks for moving this here
lets just move those inline comments to a separate line and its good to go
Comment #3
Mile23Moved the comments, plus a few other superficial coding standards changes.
Comment #4
ParisLiakos CreditAttribution: ParisLiakos commentedthanks!
Comment #5
alexpottUnicode?
And can we get some @covers annotations too?
This is never used.
Comment #6
Mile23How's that?
Comment #7
Mile23Comment #8
dawehnerThis class does not exists.
Comment #9
Mile23Doh! :-)
Changed to \Drupal\Component\Utility\Variable
Comment #12
Mile23Removed getInfo(), changed non-stdClass object to be a locally-defined class in order to avoid dependency on PHPUnit's mocking system, changed @covers to reflect current standards.
Comment #13
dawehnerfor what? :)
Comment #14
Mile23Ewps.
Improved docs, renamed test class to be more obvious.
Comment #15
dawehnerCool, thank you
Comment #16
alexpottCommitted 55240a0 and pushed to 8.x. Thanks!