function setUp() { parent::setUp(); $this->factory = TestHelper::getPartialMock('Tracker_CrossSearch_SharedFieldFactory', array('getDao')); $this->dao = new MockTracker_CrossSearch_SharedFieldDao(); $this->factory->setReturnValue('getDao', $this->dao); }
public function setUp(DiInterface $di = NULL, Config $config = NULL) { vfsStream::setup('root'); vfsStream::newFile('file.php')->at(vfsStreamWrapper::getRoot()); $this->file = vfsStream::url('root/file.php'); parent::setUp($di, $config); }
function setUp() { global $CFG; parent::setUp(); $this->olddebug = $CFG->debug; $CFG->debug = DEBUG_DEVELOPER; }
public function setUp() { parent::setUp(); $this->clear_tables(); Session::instance()->destroy(); Session::instance()->create(); }
function setUp() { // @todo mock the tokenizer $this->proc = new Elgg_Ecml_Processor(new Elgg_Ecml_Tokenizer()); elgg_register_plugin_hook_handler('view', 'output/text', 'ecml_process_view'); parent::setUp(); }
function setUp() { $this->_clean_up(); parent::setUp(); debug_mock::init($this); $this->object =& new phpbb_user(); }
/** * Set up * Initializes Config and Webapp objects */ function setUp() { $config = Config::getInstance(); $webapp = Webapp::getInstance(); $crawler = Crawler::getInstance(); parent::setUp(); }
public function setUp() { parent::setUp(); Piwik::createConfigObject(); Piwik_Config::getInstance()->setTestEnvironment(); Piwik_DataTable_Manager::getInstance()->deleteAll(); }
function setUp() { parent::setUp(); $config = new lmbSet(array('default_profile' => 'foo_profile', 'foo_profile' => array('type' => 'fckeditor', 'baz' => 42), 'bar_profile' => array('type' => 'tinymce', 'baz' => 111))); lmbToolkit::instance()->setConf('wysiwyg', $config); $this->_helper = new lmbWysiwygConfigurationHelper(); }
function setUp() { parent::setUp(); $this->conn = lmbToolkit::instance()->getDefaultDbConnection(); $this->db = new lmbSimpleDb($this->conn); $this->_cleanUp(); }
public function __construct() { parent::setUp(); $this->mdu = new BabyModule(); $this->mdu->baby = new \Appserver\Mdu\Models\BabyModel(); $this->mdu->family = new \Appserver\Mdu\Models\FamilyModel(); $this->mdu->devices = new \Appserver\Mdu\Models\DevicesModel(); }
public function setUp() { parent::setUp(); if (is_null($this->selenium)) { $this->selenium = new SimpleSeleniumRemoteControl($this->browser, $this->browserUrl, $this->host, $this->port, $this->timeout); $this->selenium->start(); } }
function setUp() { parent::setUp(); $this->wrapped_locator = new MockFileLocator(); $this->locator = new lmbCachingFileLocator($this->wrapped_locator, LIMB_VAR_DIR); $this->locator->flushCache(); $this->cache_file = $this->locator->getCacheFile(); }
/** * Sets up the test class */ public function setUp() { global $CFG; parent::setUp(); // We need to disable these if they are enabled to that we can predict // the output. $CFG->cssoptimiserstats = false; $CFG->cssoptimiserpretty = false; }
function setUp() { parent::setUp(); $this->conn = lmbToolkit::instance()->getDefaultDbConnection(); $dir_for_tests = lmb_var_dir() . '/constructor/'; $this->dir_for_test_case = $dir_for_tests . '/' . get_class($this); lmbFs::mkdir($this->dir_for_test_case); }
function setUp() { parent::setUp(); $this->_toolkit = lmbToolkit::save(); $this->_input_stream_parser = new MockInputStreamParser(); $this->_toolkit->setInputStreamParser($this->_input_stream_parser); $_SERVER['REQUEST_METHOD'] = null; $_POST = array(); }
function setUp() { parent::setUp(); $this->tools = new lmbDbTools(); $this->conn = $this->tools->getDefaultDbConnection(); $this->config = array('dsn' => 'mysql://*****:*****@localhost/hello_from_foo?charset=cp1251', 'another_dsn' => 'sqlite://*****:*****@ksu/kadrs?charset=utf8'); lmbToolkit::instance()->setConf('db', new lmbSet($this->config)); $this->tools->setDefaultDbConnection($this->tools->createDbConnection(new lmbDbDSN($this->config['dsn']))); }
function setUp() { parent::setUp(); $this->component = new WactPagerComponent('navigator'); $this->old_get = $_GET; $this->old_server = $_SERVER; $_SERVER['REQUEST_URI'] = 'http://test.com'; $_GET = array(); }
public function setUp() { parent::setUp(); ForgeConfig::store(); ForgeConfig::set('sys_dbhost', 'db_server'); ForgeConfig::set('sys_dbname', 'db'); ForgeConfig::set('svn_prefix', '/svnroot'); ForgeConfig::set('sys_dbauth_user', 'dbauth_user'); ForgeConfig::set('sys_dbauth_passwd', 'dbauth_passwd'); }
public function setUp(DiInterface $di = NULL, Config $config = NULL) { $this->createFolders(); $this->configuration = $this->createFile('config', 'config.yml'); $this->servicesDemo = $this->createFile('modules/demo/config', 'services.yml'); $this->servicesTest = $this->createFile('modules/test/config', 'services.yml'); $this->projectPath = 'vfs://root/'; $this->modules = ['test' => 'vfs://root/modules/test/', 'demo' => 'vfs://root/modules/demo/', 'fail' => 'vfs://root/modules/fail/']; parent::setUp($di, $config); }
function setUp() { parent::setUp(); $pseudoMockAccess = new MockPiwik_Access(); $pseudoMockAccess->setReturnValue('isSuperUser', true); Zend_Registry::set('access', $pseudoMockAccess); Piwik::createConfigObject(); $user_agents = array('Mozilla/6.0 (Macintosh; I; Intel Mac OS X 11_7_9; de-LI; rv:1.9b4) Gecko/2012010317 Firefox/10.0a4', 'Mozilla/5.0 (compatible; MSIE 10.6; Windows NT 6.1; Trident/5.0; InfoPath.2; SLCC1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 2.0.50727) 3gpp-gba UNTRUSTED/1.0', 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/18.6.872.0 Safari/535.2 UNTRUSTED/1.0 3gpp-gba UNTRUSTED/1.0', 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; de-at) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1'); $_SERVER['HTTP_USER_AGENT'] = $user_agents[mt_rand(0, count($user_agents) - 1)]; }
public function setUp() { parent::setUp(); $this->data_access = mock('DataAccess'); $this->data_array = array('a', 'b', 'c'); stub($this->data_access)->fetch()->returns($this->data_array); stub($this->data_access)->numRows()->returns(1); $this->result = new stdClass(); $this->dar = new DataAccessResult($this->data_access, $this->result); }
public function setUp(DiInterface $di = NULL, Config $config = NULL) { vfsStream::setup('root'); vfsStream::newFile('modules/module1/config/services.yml')->at(vfsStreamWrapper::getRoot()); vfsStream::newFile('modules/module2/config/services.yml')->at(vfsStreamWrapper::getRoot()); vfsStream::newFile('config/config.yml')->at(vfsStreamWrapper::getRoot()); $this->module1 = vfsStream::url('root/modules/module1'); $this->module2 = vfsStream::url('root/modules/module2'); $this->configFile = vfsStream::url('root/config/config.yml'); parent::setUp($di, $config); }
public function __construct() { parent::setUp(); $this->mdu = new CaptchaModule(); $this->mdu->captcha = new \Appserver\Mdu\Models\CaptchaModel(); parent::pdo('ucenter')->exec('DELETE FROM cloud_users WHERE `u_mobi` = "15280255990"'); parent::pdo()->exec('DELETE FROM cloud_mobi_captcha WHERE `mc_mobi` = "15280255990"'); parent::pdo('ucenter')->exec('INSERT INTO cloud_users(`u_name`, `u_pass`, `u_mobi`) VALUES("test", "asdf", "15280255990")'); parent::pdo('ucenter')->exec('DELETE FROM cloud_users WHERE `u_mobi` = "15280255991"'); parent::pdo()->exec('DELETE FROM cloud_mobi_captcha WHERE `mc_mobi` = "15280255991"'); parent::pdo('ucenter')->exec('DELETE FROM cloud_users WHERE `u_mobi` = "15280255992"'); }
public function setUp() { parent::setUp(); Piwik::createConfigObject(); Piwik_Config::getInstance()->setTestEnvironment(); // setup the access layer (required in Segment contrustor testing if anonymous is allowed to use segments) $pseudoMockAccess = new FakeAccess(); FakeAccess::$superUser = true; Zend_Registry::set('access', $pseudoMockAccess); // Load and install plugins $pluginsManager = Piwik_PluginsManager::getInstance(); $pluginsManager->loadPlugins(Piwik_Config::getInstance()->Plugins['Plugins']); }
/** * setUp/tearDown: Better in a constructor/destructor, but PHP4 doesn't do destructors :( */ function setUp() { parent::setUp(); if ($course = groups_get_course_info(1)) { $this->courseid = $course->id; } if ($user = groups_get_user(2)) { //Primary admin. $this->userid = $user->id; } $this->groupid = groups_create_group($this->courseid); $groupinfo = groups_set_default_group_settings(); $bok = groups_set_group_settings($this->groupid, $groupinfo); $bok = groups_add_member($this->groupid, $this->userid); }
/** * Set up * Initializes Config and Webapp objects, clears $_SESSION, $_POST, $_REQUEST */ public function setUp() { parent::setUp(); Loader::register(array(THINKUP_ROOT_PATH . 'tests/', THINKUP_ROOT_PATH . 'tests/classes/', THINKUP_ROOT_PATH . 'tests/fixtures/')); $config = Config::getInstance(); //disable caching for tests $config->setValue('cache_pages', false); //tests assume profiling is off $config->setValue('enable_profiler', false); if ($config->getValue('timezone')) { date_default_timezone_set($config->getValue('timezone')); } $webapp = Webapp::getInstance(); $crawler = Crawler::getInstance(); }
public function setUp() { parent::setUp(); TaoTestRunner::initTest(); $return = $this->rawCurl(ROOT_URL . 'tao/test/connector/setUp.php', array()); $data = json_decode($return, true); $this->assertNotNull($data); if (!defined('TAO_ROOT_URL')) { define('TAO_ROOT_URL', $data['rootUrl']); } $this->UserData = $data['userData']; $this->userUri = $data['userUri']; $this->langLookup = $data['lang']; $this->userService = new taoUserService(); $this->assertIsA($this->userService, 'taoUserService'); }
/** * Initialize Config and Webapp objects, clear $_SESSION, $_POST, $_GET, $_REQUEST */ public function setUp() { parent::setUp(); Loader::register(array(THINKUP_ROOT_PATH . 'tests/', THINKUP_ROOT_PATH . 'tests/classes/', THINKUP_ROOT_PATH . 'tests/fixtures/')); $config = Config::getInstance(); //disable caching for tests $config->setValue('cache_pages', false); //tests assume profiling is off $config->setValue('enable_profiler', false); if ($config->getValue('timezone')) { date_default_timezone_set($config->getValue('timezone')); } $webapp = Webapp::getInstance(); $crawler = Crawler::getInstance(); $this->DEBUG = getenv('TEST_DEBUG') !== false ? true : false; self::isTestEnvironmentReady(); }
public function setUp() { parent::setUp(); $di = \Phalcon\Di::getDefault(); $sqlite = $di->get('db'); $queryDir = PHASHIONBAKER_PATH . '/Payments/queries/sqllite'; if ($dh = opendir($queryDir)) { while (($file = readdir($dh)) !== false) { if (is_file($queryDir . "/" . $file)) { $query = file_get_contents($queryDir . "/" . $file); $sqlite->execute($query); } } closedir($dh); } $this->payment = new \PhashionBaker\Payments\Payments(); $this->paymentSource = new PaymentSources(); $this->paymentProcessor = new PaymentProcessors(); $this->paymentProcessor->type = 'Manual'; }