public static function destroySession() { if (self::driverInitialized()) { self::$driver->stop(); self::$driver = NULL; } }
protected function tearDown() { SessionTestCase::destroySession(); }
require_once 'PHPUnit/Framework.php'; require_once 'PHPUnit/Extensions/SeleniumTestCase.php'; error_reporting(E_ALL | E_STRICT); set_include_path(implode(PATH_SEPARATOR, array(dirname(__FILE__), dirname(__FILE__) . '/../../tine20', dirname(__FILE__) . '/../../tine20/library', get_include_path()))); require_once 'Zend/Loader/Autoloader.php'; $autoloader = Zend_Loader_Autoloader::getInstance(); $autoloader->setFallbackAutoloader(true); date_default_timezone_set('UTC'); // get config if (file_exists(dirname(__FILE__) . '/config.inc.php')) { $config = new Zend_Config(require dirname(__FILE__) . '/config.inc.php'); } else { throw new Exception("Couldn't find config.inc.php! \n"); } Zend_Registry::set('testConfig', $config); // setup tine20 session $connection = new SessionTestCase(); $connection->setBrowser('*firefox'); $connection->setBrowserUrl($config->url); $connection->start(); $connection->open($config->url); $connection->getEval("window.moveBy(-1 * window.screenX, 0); window.resizeTo(screen.width,screen.height);"); $loginPanel = new Tinebase_DOMProxy_LoginPanel(NULL, NULL, $connection); $loginPanel->findField('username')->waitForVisible(); $loginPanel->setField("username", $config->username); $loginPanel->setField("password", $config->password); $loginPanel->pressLogin(); $writer = new LogWriter($connection); $logger = new Zend_Log($writer); Zend_Registry::set('log', $logger); $logger->info('logger initialized');