protected function setUp()
{
if (!self::$_selenium_enabled) {
$this->markTestSkipped('Selenium testing not configured.');
}
$caps = $this->getDesiredCapabilities();
$this->setDesiredCapabilities(array_merge($caps, array('name' => get_class($this) . '__' . $this->getName())));
parent::setUp();
$this->setBrowserUrl($GLOBALS['TESTSUITE_URL']);
$this->_mysqli = new mysqli($GLOBALS['TESTSUITE_SERVER'], $GLOBALS['TESTSUITE_USER'], $GLOBALS['TESTSUITE_PASSWORD']);
if ($this->_mysqli->connect_errno) {
throw new Exception('Failed to connect to MySQL (' . $this->_mysqli->error . ')');
}
$this->database_name = $GLOBALS['TESTSUITE_DATABASE'] . mb_substr(md5(rand()), 0, 7);
$this->dbQuery('CREATE DATABASE IF NOT EXISTS ' . $this->database_name);
$this->dbQuery('USE ' . $this->database_name);
}