"Call to undefined method BadGroupTest::getTestInstances()" when no tests are found

MadHarold - December 11, 2007 - 14:16
Project:SimpleTest
Version:6.x-1.x-dev
Component:User interface
Category:bug report
Priority:minor
Assigned:Unassigned
Status:closed
Description

The 'BadGroupTest' class isn't loaded there, so Drupal dies with the following message:
"Fatal error: Call to undefined method BadGroupTest::getTestInstances() in /var/www/drupal/sites/all/modules/simpletest/simpletest.module on line 177"

In 'drupal_unit_tests.php' line 50 there seems to be some 'old' code (or copied from simpletest itself?) to display a message when no tests are defined.

<?php
$this
->addTestCase(new BadGroupTest($test_file, 'No new test cases'));
?>

I'd reckon that this should be changed to a 'drupal_set_message()' or something...

-H-

#1

boombatower - March 18, 2008 - 00:30
Status:active» patch (code needs review)

Here is a patch that uses drupal_set_message instead.

Rok Žlender would know if there are other reasons for keeping it the way it is. If so it still needs to be fixed.

AttachmentSize
simpletest_no_tests_found.patch676 bytes

#2

Rok Žlender - March 29, 2008 - 23:59
Status:patch (code needs review)» patch (reviewed & tested by the community)

Patch looks good.

#3

boombatower - March 30, 2008 - 00:00
Status:patch (reviewed & tested by the community)» fixed

Got the "ok" from Zlender.

Committed.

#4

Anonymous (not verified) - April 13, 2008 - 00:02
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.