I'm getting these two strict PHP warnings when I clear caches and go to the Testing page (which is reading all of the .test files to build the list of tests):

* Strict warning: Declaration of FieldUIManageFieldsTestCase::setUp() should be compatible with that of FieldUITestCase::setUp() in _registry_check_code() (line 2811 of /opt/www/eclipsework/d7dev/includes/bootstrap.inc).
* Strict warning: Declaration of FieldUIManageDisplayTestCase::setUp() should be compatible with that of FieldUITestCase::setUp() in _registry_check_code() (line 2811 of /opt/www/eclipsework/d7dev/includes/bootstrap.inc).

It looks like this is legit. FieldUiTestCase:

class FieldUITestCase extends DrupalWebTestCase {
  function setUp($modules = array()) {
...
class FieldUIManageDisplayTestCase extends FieldUITestCase {
  function setUp() {
...
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

izus’s picture

Version: 7.x-dev » 7.0
Priority: Minor » Normal

I have this error too when running tests for the first time following the steps on Documentation http://drupal.org/node/1128366

jhodgdon’s picture

Version: 7.0 » 8.x-dev
Issue tags: +Needs backport to D7

Actually this now needs to be addressed in d8 and backported to d7.

lyricnz’s picture

Status: Active » Postponed (maintainer needs more info)

Cannot reproduce, either with PHP 5.2 or 5.3. Can you describe more about how you got this error?

jhodgdon’s picture

Status: Postponed (maintainer needs more info) » Active

You have to turn on all the strict warnings in PHP, in your php.ini, in order to see these warnings, and then restart your Apache to make the settings take effect.

lyricnz’s picture

OK, I didn't know about E_STRICT. I can reproduce now.

Technically, it's warning because we're breaking polymorphism. We actually do the same thing on just about every test-case, but due to some wierdness in PHP about compile-time vs run-time, most don't show warnings.

sun’s picture

Status: Active » Reviewed & tested by the community
FileSize
575 bytes
jhodgdon’s picture

Status: Reviewed & tested by the community » Needs review

I think/hope you meant to set this to "needs review" until someone has had a chance to review your patch?

sun’s picture

Sure, if you want to hold off a braindeadsimple fix like this. We have better things to do.

jhodgdon’s picture

I was under the impression that *all* patches need a review. I don't go around marking my doc patches that fix simple typos RTBC... maybe I should? I don't think so.

izus’s picture

#6: drupal.fieldui-test-strict.6.patch queued for re-testing.

lyricnz’s picture

Status: Needs review » Reviewed & tested by the community

Code is fine.

webchick’s picture

Status: Reviewed & tested by the community » Needs work

Uh. Sorry, but I totally can't follow what's going on there. I mean, I can of course read the code. But we need a comment there to the effect of "Like FieldTestCase::setUp(), allow for modules passed in as either an array or strings."

Additionally, both DrupalWebTestCase::setUp() and FieldTestCase::setUp() write this line as:

    $modules = func_get_args();
    if (isset($modules[0]) && is_array($modules[0])) {
      $modules = $modules[0];
    }

...rather than consolidating. We should do the same here, for legibility.

So, yes. Even "braindeadsimple" fixes need reviews. :)

lyricnz’s picture

Status: Needs work » Needs review
FileSize
779 bytes

Cut and paste from FieldTestCase

Status: Needs review » Needs work

The last submitted patch, drupal.fieldui-test-strict.12.patch, failed testing.

sun’s picture

+++ b/modules/field_ui/field_ui.test
@@ -10,8 +10,10 @@
+    $modules[] = 'field_test';

You missed this line from the last patch.

Powered by Dreditor.

lyricnz’s picture

Status: Needs work » Needs review
FileSize
811 bytes

Lame.

sun’s picture

Status: Needs review » Reviewed & tested by the community
webchick’s picture

Status: Reviewed & tested by the community » Fixed

Awesome, thanks!

Committed to 8.x and 7.x.

Status: Fixed » Closed (fixed)
Issue tags: -Needs backport to D7

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

The last submitted patch, 13: drupal.fieldui-test-strict.12.patch, failed testing.