Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When you create a test class, that extends DrupalWebTestCase and you just override
setUp()
without calling:
parent::setUp();
then simpletest will delete your real database. This is not a real bug, since DrupalWebTestCase::setUp() is the place, where a test prefix is created, but it would be a real good idea to don't allow to delete the database tables, when there is no prefix.
Comments
Comment #1
xjmLooks like a duplicate of #1212992: Prevent tests from deleting main installation's tables when parent::setUp() is not called which was resolved a number of years back. Thanks for reporting this!