require_once W2P_BASE_DIR . '/includes/main_functions.php'; require_once W2P_BASE_DIR . '/includes/config.php'; require_once W2P_BASE_DIR . '/includes/db_adodb.php'; /* * Need this to not get the annoying timezone warnings in tests. */ $defaultTZ = w2PgetConfig('system_timezone', 'UTC'); $defaultTZ = '' == $defaultTZ ? 'UTC' : $defaultTZ; date_default_timezone_set($defaultTZ); /* * Need this to test actions that require permissions. */ $AppUI = new w2p_Core_CAppUI(); $_POST['login'] = '******'; $_REQUEST['login'] = '******'; $AppUI->login('admin', 'passwd'); $AppUI->user_email = '*****@*****.**'; class CommonSetup extends PHPUnit_Framework_TestCase { protected $backupGlobals = false; protected $obj = null; protected $post_data = array(); protected $mockDB = null; protected $_AppUI = null; protected function setUp() { parent::setUp(); global $AppUI; $this->_AppUI = $AppUI; $this->_AppUI->restoreObject(); $this->mockDB = new w2p_Mocks_Query();