Skip to content

Instantly share code, notes, and snippets.

@ygerasimov
Created April 26, 2011 13:44
Show Gist options
  • Save ygerasimov/942284 to your computer and use it in GitHub Desktop.
Save ygerasimov/942284 to your computer and use it in GitHub Desktop.
// Get database prefix.
$database_prefix = $GLOBALS['drupal_test_info']['test_run_id'];
// Generate user agent string.
if (preg_match('/simpletest\d+/', $database_prefix, $matches)) {
$user_agent = drupal_generate_test_ua($matches[0]);
}
else {
throw new Exception('Test is not ready to init connection to Webdriver (no database prefix)');
}
// Get database prefix.
$database_prefix = $GLOBALS['drupal_test_info']['test_run_id'];
// Generate user agent string.
if (preg_match('/simpletest\d+/', $database_prefix, $matches)) {
$user_agent = drupal_generate_test_ua($matches[0]);
}
else {
throw new Exception('Test is not ready to init connection to Webdriver (no database prefix)');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment