I'm trying to customize the simpletest module and I'd like to use a db_prefix different from the one randomly generated by simpletest (because I want to test an already setup Drupal site). However, it seems the $db_prefix_new simpletest uses to switch back and forth from the host to the client is expected to be of the form {current_db_prefix} . 'simpletest' . {digits} as set in the setUp() method:
$db_prefix_new = $db_prefix . 'simpletest' . mt_rand(1000, 1000000);
If I change $db_prefix_new to some other string of my own which does not start with $db_prefix . 'simpletest', the setUp() works and Drupal gets installed properly using the specified new db prefix and these tables are removed in the end during the tearDown(), but the tests fail because it is not testing the client (at $new_db_prefix) but the host: enabling verbose option reveals that the site being tested by the test browser is the host site (even though setting new users with drupalCreateUser() etc. is effectively done in the client drupal instance). So my question is, is this simpletest browser implemented through cURL somehow restricting the db_prefix to something of the form $db_prefix . 'simpletest' ?
Comments
Comment #1
scor commentedok I found the solution, it's in the patch for core: