3

I'm only just getting into TDD with Drupal and unfortunately run into trouble right away. For some reason the simpletest####field_config table isn't being created, and I don't get why; many other tables do get created. The (seemingly) relevant part of the error I get is:

Base table or view not found: 1146 Table 'mcdonalds.simpletest405637field_config&#039

coming from /modules/field/field.crud.inc (that is the project's root modules folder, NOT the modules folder in any theme or something).

I'm a bit stuck here, so I hope someone can tell me how to debug this, or even how to solve, that would be great of course;) Thanks!

3 Answers 3

5

The issue is definitely related to cache backends.

Disable cache backends if you are testing using Simpletest classes.

0
0

It's not that the table doesn't get created, it's that something is reaching for field info before the table is there. That's not unheard of. What you need to do is use a debugger or file_put_contents('/tmp/log', print_r(debug_backtrace(), TRUE)); and take a good look of where field info gets called. Something leaks into the install that simpletest runs.

4
  • Hm, well that gives me some indications, but it doesn't really help. The generated trace stops in the settings file, but nothing interesting seems to be happening there, there are no functions being called, only vars defined. Any idea what I could be doing wrong in the settings file causing anything to annoy the db? Commented Apr 2, 2013 at 13:37
  • Correction, it stops in includes/bootstrap.inc where it calls include_once DRUPAL_ROOT . '/' . conf_path() . '/settings.php';. Commented Apr 2, 2013 at 13:44
  • Uh what's in your settings.php? Can you scrub passwords from it and make available as a .txt somewhere?
    – user49
    Commented Apr 2, 2013 at 18:20
  • Yes, here you go, but I'm guessing the log should go somewhere else? Commented Apr 3, 2013 at 11:05
0

I was having the same issue. Following the discussion above I found that while I had File Cache disabled, I still had $conf['cache_backends'] and $conf['cache_default_class'] defined in my settings.php file. Commenting out those lines fixed the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.