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.
From #520106-132: Allow setting the active menu trail for dynamically-generated menu paths., apparently classes which inherit from DrupalWebTestCase need to have the following function signature for setUp:
function setUp() {
// ...
}
In FieldAttachTestCase, the signature is
function setUp($modules = array()) {
// ...
}
which apparently can raise an E_STRICT warning.
Instead we should use something like
function setUp() {
$modules = func_get_args();
if (isset($modules[0]) && is_array($modules[0])) {
$modules = $modules[0];
}
// ...
Comment | File | Size | Author |
---|---|---|---|
#6 | FieldAttachTestCase-1273722-7.patch | 871 bytes | bfroehle |
#1 | FieldAttachTestCase-1273722-1.patch | 1.23 KB | bfroehle |
Comments
Comment #1
bfroehle CreditAttribution: bfroehle commentedCode borrowed from DrupalWebTestCase::setUp(), of course.
Comment #2
bfroehle CreditAttribution: bfroehle commentedThis should be trivial to review and fixes an E_STRICT warning.
Comment #3
sunThat's 100% correct. Thank you!
Comment #4
sun#1: FieldAttachTestCase-1273722-1.patch queued for re-testing.
Comment #5
catchCommitted/pushed to 8.x, will need a quick re-roll for 7.x.
Comment #6
bfroehle CreditAttribution: bfroehle commentedQuick re-roll for D7...
$ curl http://drupal.org/files/FieldAttachTestCase-1273722-1.patch | git apply -p2 --index
Comment #7
webchickHuh. Weird. I thought we changed DWTC::setUp() some time ago to take $modules as a parameter and get away from the function_get_args() way. Hm. Well, ok, then...
Committed and pushed to 7.x. Thanks!