本文整理汇总了PHP中WebTestCase类的典型用法代码示例。如果您正苦于以下问题:PHP WebTestCase类的具体用法?PHP WebTestCase怎么用?PHP WebTestCase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WebTestCase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
/**
* @see WebTestCase::setUp()
*/
protected function setUp()
{
parent::setUp();
$this->editorBasePath = $this->baseUrl . '/index.php/lucene-test/editor/';
}
示例2: tearDown
protected function tearDown()
{
parent::tearDown();
$pluginSettingsDao = DAORegistry::getDAO('PluginSettingsDAO');
/* @var $pluginSettingsDao PluginSettingsDAO */
$pluginSettingsDao->_getCache(0, 'luceneplugin')->flush();
}
示例3: setUp
protected function setUp()
{
parent::setUp();
$election = Election::model()->findByPk(1);
$election->status = Election::STATUS_REGISTRATION;
$election->save(false);
}
示例4: setUp
/**
* 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);
}
}
}
示例5: setUp
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;
}
示例6: setUp
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');
}
示例7: setUp
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);
}
示例8: setUpBeforeClass
/**
* @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();
}
示例9: setUp
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');
}
示例10: database
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";
}
示例11: __construct
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';
}
示例12: onNotSuccessfulTest
/**
* @see PHPUnit_Extensions_SeleniumTestCase::onNotSuccessfulTest()
*/
protected function onNotSuccessfulTest($e)
{
// Restart the Selenium session to avoid overlay of
// error messages.
$this->start();
parent::onNotSuccessfulTest($e);
}
示例13: testCreateJournalLogin
/**
* Prepare for tests.
*/
function testCreateJournalLogin()
{
parent::logIn('admin', 'admin');
}
示例14: setUp
protected function setUp()
{
parent::setUp();
}
示例15: tearDown
protected function tearDown()
{
parent::tearDown();
$this->deleteTmpDir('ORM');
}