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];
  }
  // ...
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bfroehle’s picture

Status: Active » Needs review
FileSize
1.23 KB

Code borrowed from DrupalWebTestCase::setUp(), of course.

bfroehle’s picture

Issue tags: +Needs backport to D7

This should be trivial to review and fixes an E_STRICT warning.

sun’s picture

Status: Needs review » Reviewed & tested by the community

That's 100% correct. Thank you!

sun’s picture

#1: FieldAttachTestCase-1273722-1.patch queued for re-testing.

catch’s picture

Version: 8.x-dev » 7.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed/pushed to 8.x, will need a quick re-roll for 7.x.

bfroehle’s picture

Status: Patch (to be ported) » Reviewed & tested by the community
FileSize
871 bytes

Quick re-roll for D7...
$ curl http://drupal.org/files/FieldAttachTestCase-1273722-1.patch | git apply -p2 --index

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Huh. 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!

Automatically closed -- issue fixed for 2 weeks with no activity.