After squeezing my head some time looking for the problem why I could not run the actual tests, I end up noticing that the real problem was that I am using PHP 5.3 and in that version we need to change how setUp() method works in order to successfully run the tests.

Now we use:

call_user_func_array(array($this, 'parent::setUp'), $modules);

but that do not seems to work in 5.3, so I have two alternatives working, but not really sure which one is better:

// calling the method statically?
call_user_func_array(array(__CLASS__, 'parent::setUp'), $modules);

and

// one mentioned way on a comment at http://php.net/call_user_func_array
call_user_func_array('parent::setUp', $modules);

This happens also to project_issue module tests, since it use the same technique to load modules at setup in children test classes.

Comments

marvil07’s picture

Assigned: Unassigned » marvil07
Status: Active » Needs review
StatusFileSize
new997 bytes

On versionocontrol api we are using the first alternative(but directly writing the class name):

call_user_func_array(array('VersioncontrolTestCase', 'parent::setUp'), $modules);

Actually, for this to work on php 5.3, I had to change project test too. I'll be creating the other patch now.

Please test this on php 5.2 too.

marvil07’s picture

So, uploaded the patch that is actually for project_issue :-p(the complement), here is the right one.

marvil07’s picture

Actually there was a related issue already created with another patch ;-) #992892-1: Tests not working with PHP 5.3, so both patches ready for review!

dww’s picture

Status: Needs review » Fixed

Confirmed all tests are still passing in PHP 5.2. Pushed to master:
http://drupal.org/commitlog/commit/122/a8428c55b9e8cdfcb422f03b60b568e4e...
Thanks!
-Derek

Status: Fixed » Closed (fixed)

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

kenorb’s picture

Similar issue: #1107770: Mollom: Maximum function nesting level of '400' reached, aborting! in tests/mollom.test on line 83
Other syntax which could fix that compatibility:

parent::setUp($modules);

or:

call_user_func_array('parent::setUp', $modules);