protected function tearDown() { parent::tearDown(); $pluginSettingsDao = DAORegistry::getDAO('PluginSettingsDAO'); /* @var $pluginSettingsDao PluginSettingsDAO */ $pluginSettingsDao->_getCache(0, 'luceneplugin')->flush(); }
protected function setUp() { parent::setUp(); $election = Election::model()->findByPk(1); $election->status = Election::STATUS_REGISTRATION; $election->save(false); }
/** * BACKGROUND: * GIVEN I enabled the "most read articles" block plugin * AND I enabled a metric providing plugin. * * @see PKPTestCase::setUp() */ protected function setUp() { parent::setUp(); // Enable the "most read articles" plugin. $pluginSettingsDao = DAORegistry::getDAO('PluginSettingsDAO'); /* @var $pluginSettingsDao PluginSettingsDAO */ $pluginSettingsDao->updateSetting(2, 'MostReadBlockPlugin', 'enabled', true); $pluginSettingsDao->updateSetting(2, 'MostReadBlockPlugin', 'context', BLOCK_CONTEXT_SIDEBAR); $pluginSettingsDao->updateSetting(2, 'MostReadBlockPlugin', 'seq', 1); // Enable a metric-providing plugin. $pluginSettingsDao->updateSetting(0, 'OasPlugin', 'enabled', true); // Generate test metric data. $dates = array(date('Ymd', strtotime('-15 days')), date('Ymd', strtotime('-45 days')), date('Ymd', strtotime('-2 years'))); $record = array('load_id' => 'most-read-test', 'assoc_type' => ASSOC_TYPE_GALLEY, 'metric_type' => 'oas::counter'); $metricsDao = DAORegistry::getDAO('MetricsDAO'); /* @var $metricsDao MetricsDAO */ foreach ($dates as $date) { $record['day'] = $date; foreach (array('4' => 5, '6' => 10) as $assocId => $metric) { $record['assoc_id'] = $assocId; $record['metric'] = $metric; $metricsDao->insertRecord($record); } } }
public function setUp() { if (self::$fixturesLoaded) { return; } $this->loadFixtures(array('AppBundle\\DataFixtures\\PHPCR\\LoadStaticPageData', 'AppBundle\\DataFixtures\\PHPCR\\LoadMenuData', 'AppBundle\\DataFixtures\\PHPCR\\LoadRoutingData', 'AppBundle\\DataFixtures\\PHPCR\\LoadSimpleCmsData'), null, 'doctrine_phpcr'); self::$fixturesLoaded = true; }
public function setUp() { parent::setUp(); $this->pool = $this->getContainer()->get('sonata.admin.pool'); $this->router = $this->getContainer()->get('router'); $this->client = $this->createClientAuthenticated(); $this->dm = $this->getContainer()->get('doctrine_phpcr.odm.default_document_manager'); }
protected function setUp() { parent::setUp(); $this->truncateTables(); $appLogger = $this->appLogger = Yii::app()->getComponent('log')->routes['info_log']; $logFilePath = $this->logFilePath = $appLogger->logPath . '/' . $appLogger->logFile; $this->deleteFile($logFilePath); $identifiersImagesDirPath = $this->identifiersImagesDirPath = Yii::getPathOfAlias('frontend.www') . Yii::app()->getModule('personIdentifier')->imagesDir; // self::removeDirectory($identifiersImagesDirPath); }
/** * @copydoc PHPUnit_Framework_TestCase::setUpBeforeClass() */ public static function setUpBeforeClass() { // Retrieve and check configuration. self::$baseUrl = getenv('BASEURL'); self::$timeout = (int) getenv('TIMEOUT'); if (!self::$timeout) { self::$timeout = 30; } // Default 30 seconds parent::setUpBeforeClass(); }
protected function setUp() { parent::setUp(); //$this->setAutoStop(false); $this->start(); $this->open(''); // login $this->clickAndWait('link=Login'); $this->type('name=LoginForm[username]', 'admin'); $this->click("//input[@value='Login']"); $this->waitForTextPresent('Password cannot be blank.'); $this->type('name=LoginForm[password]', 'test'); $this->clickAndWait("//input[@value='Login']"); $this->clickAndWait('link=Users'); }
function __construct() { parent::__construct(); global $configure; $this->url = $configure['urlwebsite']; $this->cdashpro = false; if (isset($configure['cdashpro']) && $configure['cdashpro'] == '1') { $this->cdashpro = true; } global $db; $this->db =& new database($db['type']); $this->db->setDb($db['name']); $this->db->setHost($db['host']); $this->db->setPort($db['port']); $this->db->setUser($db['login']); $this->db->setPassword($db['pwd']); global $cdashpath; $this->logfilename = $cdashpath . "/backup/cdash.log"; }
public function __construct() { parent::__construct(); global $configure; $this->url = $configure['urlwebsite']; $this->cdashpro = false; if (isset($configure['cdashpro']) && $configure['cdashpro'] == '1') { $this->cdashpro = true; } global $db; $this->db = new database($db['type']); $this->db->setDb($db['name']); $this->db->setHost($db['host']); $this->db->setPort($db['port']); $this->db->setUser($db['login']); $this->db->setPassword($db['pwd']); global $CDASH_LOG_FILE, $cdashpath; $this->logfilename = $CDASH_LOG_FILE; $this->configfilename = $cdashpath . '/config/config.local.php'; }
/** * @see PHPUnit_Extensions_SeleniumTestCase::onNotSuccessfulTest() */ protected function onNotSuccessfulTest($e) { // Restart the Selenium session to avoid overlay of // error messages. $this->start(); parent::onNotSuccessfulTest($e); }
/** * Prepare for tests. */ function testCreateJournalLogin() { parent::logIn('admin', 'admin'); }
protected function setUp() { parent::setUp(); }
protected function tearDown() { parent::tearDown(); $this->deleteTmpDir('ORM'); }
public function __construct($name = null, array $data = array(), $dataName = '') { parent::__construct($name, $data, $dataName); $this->validationServiceAvailable = $this->isValidationServiceAvailable(); }
/** * @see WebTestCase::setUp() */ protected function setUp() { parent::setUp(); $this->editorBasePath = $this->baseUrl . '/index.php/lucene-test/editor/'; }
function get($url, $parameters = NULL) { $parts = array(); if (preg_match('#([\\w-]*):([\\w-]+|[^/]|$)((:(.*))*)#', $url, $parts) != 0 && $parts[1] != 'mailto') { list($zone_name, $vars, $hash) = page_link_decode($url); $real_url = _build_url($vars, $zone_name, NULL, false, false, false, $hash); $ret = parent::get($real_url, $parameters); } else { $ret = parent::get($url, $parameters); } // Save, so we can run validation on it later $path = get_file_base() . '/_tests/html_dump/' . get_class($this); if (!file_exists($path)) { mkdir($path, 0777); } $content = $this->_browser->getContent(); $outfile = fopen($path . '/' . url_to_filename($url) . '.htm', 'wb'); fwrite($outfile, $content); fclose($outfile); sync_file($path . '/' . url_to_filename($url) . '.htm'); fix_permissions($path . '/' . url_to_filename($url) . '.htm'); // Save the text so we can run through Word's grammar checker $text_content = $content; $text_content = preg_replace('#<[^>]* title="([^"]+)"<[^>]*>#U', '\\1', $text_content); $text_content = preg_replace('#<[^>]* alt="([^"]+)"<[^>]*>#U', '\\1', $text_content); $text_content = preg_replace('#<style[^>]*>.*</style>#Us', '', $text_content); $text_content = preg_replace('#<script[^>]*>.*</script>#Us', '', $text_content); $text_content = preg_replace('#<[^>]*>#U', '', $text_content); $text_content = preg_replace('#\\s\\s+#', '. ', $text_content); $text_content = str_replace('–', '-', $text_content); $text_content = str_replace('—', '-', $text_content); $text_content = str_replace('…', '...', $text_content); $text_content = @html_entity_decode($text_content, ENT_QUOTES); $outfile = fopen($path . '/' . url_to_filename($url) . '.txt', 'wb'); fwrite($outfile, $text_content); fclose($outfile); return $ret; }
public function __construct() { parent::__construct('PHP_Merchant_Paypal_Express_Checkout Remote Unit Tests'); }
protected function setUp() { parent::setUp(); $this->productFixture = $this->manager->loadFixture('catalog/product'); }
public function setUp() { parent::setUp(); $this->client = $this->createClient(); }
public static function tearDownAfterClass() { parent::deleteTmpDir('StandardFormLogin'); }
protected function tearDown() { parent::tearDown(); $this->deleteTmpDir('SessionTest'); }
public function setUp() { $this->servicio = new Servicios(); parent::setUp(); }
public function setUp() { $this->getFixtureManager()->basePath = Yii::getPathOfAlias('application.modules.pages.tests.fixtures'); parent::setUp(); }
public function __construct() { parent::WebTestCase(); $this->ci =& get_instance(); }
protected function setUp() { parent::setUp(); $this->orderFixture = $this->manager->loadFixture('sales/quote'); }
protected function tearDown() { parent::tearDown(); $this->deleteTmpDir('StandardFormLogin'); }
function TestOfPagerPOST($name = 'Test of Pager with httpMethod="POST"') { parent::__construct($name); }
public function __construct() { $this->_indexName = CATSUtility::getIndexName(); $this->_indexURL = CATSUtility::getAbsoluteURI($this->_indexName); parent::__construct(); }
public function __construct($name = NULL, array $data = array(), $dataName = '') { parent::__construct($name, $data, $dataName); $this->secretFile = str_replace(DIRECTORY_SEPARATOR, '/', realpath(__DIR__ . '/data/hidden.txt')); $this->secretContent = trim(file_get_contents($this->secretFile)); }