/**
  * @copydoc PHPUnit_Framework_TestCase::setUp()
  */
 protected function setUp()
 {
     // Switch off xdebug screaming (there are
     // errors in adodb...).
     PKPTestHelper::xdebugScream(false);
     // Make sure we have a db connection (some tests
     // might close it and that affects the next ones).
     DBConnection::getInstance()->reconnect();
     // Backup affected tables.
     $affectedTables = $this->getAffectedTables();
     if (is_array($affectedTables)) {
         PKPTestHelper::backupTables($affectedTables, $this);
     }
     parent::setUp();
 }
 /**
  * @copydoc PHPUnit_Framework_TestCase::setUp()
  */
 protected function setUp()
 {
     $screenshotsFolder = 'lib/pkp/tests/results';
     $this->screenshotPath = BASE_SYS_DIR . '/' . $screenshotsFolder;
     $this->screenshotUrl = getenv('BASEURL') . '/' . $screenshotsFolder;
     if (empty(self::$baseUrl)) {
         $this->markTestSkipped('Please set BASEURL as an environment variable.');
     }
     // Set the URL for the script that generates the selenium coverage reports
     $this->coverageScriptUrl = self::$baseUrl . '/' . $this->coverageScriptPath;
     $this->setTimeout(self::$timeout);
     // See PKPTestCase::setUp() for an explanation
     // of this code.
     if (function_exists('_array_change_key_case')) {
         global $ADODB_INCLUDED_LIB;
         $ADODB_INCLUDED_LIB = 1;
     }
     // This is not Google Chrome but the Firefox Heightened
     // Privilege mode required e.g. for file upload.
     $this->setBrowser('*chrome');
     $this->setBrowserUrl(self::$baseUrl . '/');
     if (Config::getVar('general', 'installed')) {
         $affectedTables = $this->getAffectedTables();
         if (is_array($affectedTables)) {
             PKPTestHelper::backupTables($affectedTables, $this);
         }
     }
     $cacheManager = CacheManager::getManager();
     $cacheManager->flush(null, CACHE_TYPE_FILE);
     $cacheManager->flush(null, CACHE_TYPE_OBJECT);
     // Clear ADODB's cache
     if (Config::getVar('general', 'installed')) {
         $userDao = DAORegistry::getDAO('UserDAO');
         // As good as any
         $userDao->flushCache();
     }
     parent::setUp();
 }