Moved the code from #5 to DrupalTestCase and wrapped the call to drupal_static_reset in the connector