Hi,

It seems an API change (maybe from #208144) affecting backported D5 and D6 simpletest modules means that hook_simpletest() has been deprecated and is not called. Now Simpletest simply scans for a test dir with .test files in it, which is ok.

The problem is test cases such as UserImportNodeprofile extend UserImportTest, which isn't included yet because of the order that SimpleTest includes the test files. I recommend you add a module_load_include('test', 'user_import', 'tests/user_import') to the top of the test files that include that one, just to make sure they're loaded.

The error that occurs on admin/build/testing is:

Fatal error: Class 'UserImportTest' not found in /var/www/signon/sites/all/modules/user_import/tests/user_import_nodeprofile.test on line 6

This prevents any other test cases being run.

Comments

neilnz’s picture

EliseVanLooij’s picture

I'm having the same problem and I can report that the proposed solution ("add a module_load_include('test', 'user_import', 'tests/user_import') to the top of the test files") does solve the original error but throws up a new error:

Class 'DrupalTestCase' not found in /Drupal6/sites/all/modules/contrib/user_import/tests/user_import.test 

Removing the user_import module altogether (I hadn't even activated it yet) solves all problems.

neilnz’s picture

Yes. The reason for this is there are two versions of Simpletest out there now, 1.x and 2.x. We're now using 2.x and it detects obsolete 1.x test cases by checking if they extend DrupalTestCase rather than DrupalWebTestCase. Since these ones extend UserImportTest (which then extends DrupalTestCase), it doesn't detect them as 1.x test cases, so tries to include them and fails, because DrupalTestCase isn't available in 2.x.

The real solution here is to just delete the tests from the user import module, since they won't work with SimpleTest 2.x yet anyway.

Some, like the one for testing node profile, aren't even relevant to the D6 version of the module, so should be removed from the module anyway.

nzcodarnoc’s picture

#3 worked for me

cd user_import/
rm -rf tests/

robert castelo’s picture

Status: Active » Closed (fixed)

6.x-3.0-beta1 contains updates to the tests. Not all are fixed yet, but it doesn't crash Simple Test anymore.

owen barton’s picture

Here is a trivial patch for people who want to get simpletest in an older version running.