5

I am in the processes of developing a module. I am trying to incorporate SimpleTest module in order to have a separate place that contains my code tests.

However, when I try to run a query against the tables in the database, which are build by me, I get: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'playground.simpletest311135TABLENAME It tries to find a table simpletest311135TABLENAME while it should look for TABLENAME. It always adds simpletest and some random number.

When I run queries against drupal default tables, like users and sessions, everything works perfect. Any workaround?

Giannis

2 Answers 2

5

This behavior is correct. SimpleTest sets up a new site environment for every test case, using a table name prefix.

You probably forgot to install your module by overriding the setUp() method. Once your module is installed the query should work.

0

I got this error when I failed to call the superclass's tearDown() method. Once I put that back in place, the error went away.

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.