Hi,

I got the following error when drupal_mail_send is called from my test:

Fatal error: Class 'DrupalWebTestCase' not found in /usr/src/simpletest/simpletest.test on line 12

See the attached traceback for details.

I think this is related to simpletest.test being defined as the smtp library by drupal_web_test_case.php:1173:

    variable_set('smtp_library', drupal_get_path('module', 'simpletest') . '/simpletest.test');

Causing later it's inclusion from mail.inc:176 and in this context drupal_web_test_case.php is not included and thus 'DrupalWebTestCase' is not defined.

Let me know if you need more informations.

CommentFileSizeAuthor
#2 OSPokerSpecifications-10.html_.gz1.46 KBproppy

Comments

proppy’s picture

Here is the comment before drupal_mail_wrapper definition in simpletest.test:

* Code copied from TestingMailSystem in mail.sending.inc (Drupal 7). Placed in                                                                                                  
* this file to ensure no loaded until in testing mode, to ensure no conflicts                                                                                                   
* with other implementations like devel.                                                 
proppy’s picture

StatusFileSize
new1.46 KB

A tentative workaround:

diff -r a36c4cb6046f usr/src/simpletest/simpletest.test
--- a/usr/src/simpletest/simpletest.test        Fri Nov 27 10:02:04 2009 +0100
+++ b/usr/src/simpletest/simpletest.test        Fri Nov 27 10:12:22 2009 +0100
@@ -9,6 +9,8 @@
  * Copyright 2008-2009 by Jimmy Berry ("boombatower", http://drupal.org/user/214218)
  */

+require_once drupal_get_path('module', 'simpletest') . '/drupal_web_test_case.php';
+
 class SimpleTestFunctionalTest extends DrupalWebTestCase {
   /**
    * The results array that has been parsed by getTestResults().
proppy’s picture

Status: Active » Closed (duplicate)