本文整理汇总了PHP中WebTestCase::setUp方法的典型用法代码示例。如果您正苦于以下问题:PHP WebTestCase::setUp方法的具体用法?PHP WebTestCase::setUp怎么用?PHP WebTestCase::setUp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebTestCase
的用法示例。
在下文中一共展示了WebTestCase::setUp方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
protected function setUp()
{
parent::setUp();
$election = Election::model()->findByPk(1);
$election->status = Election::STATUS_REGISTRATION;
$election->save(false);
}
示例2: 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);
}
}
}
示例3: 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');
}
示例4: 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);
}
示例5: 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');
}
示例6: setUp
/**
* BACKGROUND:
* GIVEN I am on the journal settings page step 1 (details)
*
* @see WebTestCase::setUp()
*/
protected function setUp()
{
parent::setUp();
// OJS pages and Selenium locators required for test.
$this->pages = array('journal-setup' => array('url' => $this->baseUrl . '/index.php/test/manager/setup/%id'), 'settings' => array('url' => $this->baseUrl . '/index.php/test/manager/plugins', 'doiPrefix' => 'css=input[id^="doiPrefix"]', 'reassignDOIs' => 'css=a[id^="doiSettingsForm-reassignDOIs-button"]', 'formError' => '//ul[@class="pkp_form_error_list"]//a[@href="#%id"]'), 'issue' => array('url' => $this->baseUrl . '/index.php/test/issue/view/%id', 'visible' => '//a[@id="pub-id::doi"]'), 'article' => array('url' => $this->baseUrl . '/index.php/test/article/view/%id', 'visible' => '//a[@id="pub-id::doi"]', 'DC-meta' => '//meta[@name="DC.Identifier.DOI"]@content', 'Google-meta' => '//meta[@name="citation_doi"]@content'), 'article-rt-indexing' => array('url' => $this->baseUrl . '/index.php/test/rt/metadata/%id/0', 'visible' => '//tr/td[text()="Digital Object Identifier"]/../td[last()]'), 'article-rt-citations-apa' => array('url' => $this->baseUrl . '/index.php/test/rt/captureCite/%id/0/ApaCitationPlugin', 'visible' => 'id=citation'), 'galley' => array('url' => $this->baseUrl . '/index.php/test/article/view/%id/1', 'visible' => '//a[@id="pub-id::doi"]', 'DC-meta' => '//meta[@name="DC.Identifier.DOI"]@content', 'Google-meta' => '//meta[@name="citation_doi"]@content'), 'metadata-issue' => array('url' => $this->baseUrl . '/index.php/test/editor/issueData/%id', 'urlSuffix' => 'id=publicIssueId'), 'metadata-article' => array('url' => $this->baseUrl . '/index.php/test/editor/viewMetadata/%id', 'urlSuffixPage' => $this->baseUrl . '/index.php/test/editor/issueToc/%id', 'urlSuffix' => 'name=publishedArticles[1]'), 'metadata-galley' => array('url' => $this->baseUrl . '/index.php/test/editor/editGalley/%id/1', 'urlSuffix' => 'id=publicGalleyId'));
// The meta-data pages have uniform structure.
foreach ($this->objectTypes as $objectType) {
$objectType = strtolower_codesafe($objectType);
$this->pages["metadata-{$objectType}"] += array('doi' => '//div[@id="pub-id::doi"]', 'doiInput' => '//div[@id="pub-id::doi"]//input', 'formError' => '//ul[@class="pkp_form_error_list"]//a[@href="#%id"]');
}
// Start Selenium.
$this->start();
// Log in to OJS as admin.
$this->logIn();
// Open the DOI settings page.
$this->openSettingsPage();
}
示例7: setUp
/**
* @see WebTestCase::setUp()
*/
protected function setUp()
{
parent::setUp();
// OJS pages and Selenium locators required for test.
// the setup page
// there coul be several pages for a object type
// metadata pages
$this->pages = array('journal-setup' => array('url' => $this->baseUrl . '/index.php/test/manager/setup/%id'), 'settings' => array('url' => $this->baseUrl . '/index.php/test/manager/plugin/pubIds/URNPubIdPlugin/settings', 'urnPrefix' => 'id=urnPrefix', 'clearURNs' => 'name=clearPubIds', 'formError' => '//ul[@class="pkp_form_error_list"]//a[@href="#%id"]'), 'issue' => array(array('url' => $this->baseUrl . '/index.php/test/issue/view/%id', 'visible' => '//a[@id="pub-id::other::urn"]')), 'article' => array(array('url' => $this->baseUrl . '/index.php/test/article/view/%id', 'visible' => '//a[@id="pub-id::other::urn"]', 'DC-meta' => '//meta[@name="DC.Identifier.URN"]@content', 'Google-meta' => '//meta[@name="citation_urn"]@content'), array('url' => $this->baseUrl . '/index.php/test/rt/metadata/%id/0', 'visible' => '//tr/td[text()="Uniform Resource Name"]/../td[last()]')), 'galley' => array(array('url' => $this->baseUrl . '/index.php/test/article/view/%id/1', 'visible' => '//a[@id="pub-id::other::urn"]', 'DC-meta' => '//meta[@name="DC.Identifier.URN"]@content', 'Google-meta' => '//meta[@name="citation_urn"]@content')), 'suppfile' => array(array('url' => $this->baseUrl . '/index.php/test/rt/suppFileMetadata/%id/0/1', 'visible' => '//tr/td[text()="Uniform Resource Name"]/../td[last()]')), 'metadata-issue' => array('url' => $this->baseUrl . '/index.php/test/editor/issueData/%id', 'urlSuffix' => 'id=publicIssueId'), 'metadata-article' => array('url' => $this->baseUrl . '/index.php/test/editor/viewMetadata/%id', 'urlSuffixPage' => $this->baseUrl . '/index.php/test/editor/issueToc/1', 'urlSuffix' => 'name=publishedArticles[1]'), 'metadata-galley' => array('url' => $this->baseUrl . '/index.php/test/editor/editGalley/%id/1', 'urlSuffix' => 'id=publicGalleyId'), 'metadata-suppfile' => array('url' => $this->baseUrl . '/index.php/test/editor/editSuppFile/%id/1', 'urlSuffix' => 'id=publicSuppFileId'));
// The meta-data pages have uniform structure.
foreach ($this->objectTypes as $objectType) {
$objectType = strtolower($objectType);
$this->pages["metadata-{$objectType}"] += array('urn' => '//div[@id="pub-id::other::urn"]', 'urnInput' => '//div[@id="pub-id::other::urn"]//input[@name="urnSuffix"]', 'formError' => '//ul[@class="pkp_form_error_list"]//a[@href="#urnSuffix"]');
}
// Start Selenium.
$this->start();
// Log in to OJS as admin.
$this->logIn();
// Open the settings page step 1 (details).
$this->openSettingsPage();
}
示例8: setUp
protected function setUp()
{
parent::setUp();
$this->deleteTmpDir('ORM');
}
示例9: setUp
/**
* @see WebTestCase::setUp()
*/
protected function setUp()
{
parent::setUp();
$this->editorBasePath = $this->baseUrl . '/index.php/lucene-test/editor/';
}
示例10: setUp
protected function setUp()
{
parent::setUp();
$this->orderFixture = $this->manager->loadFixture('sales/quote');
}
示例11: setUp
protected function setUp()
{
parent::setUp();
$this->addressFixture = $this->manager->loadFixture('customer/address');
}
示例12: setUp
public function setUp()
{
$this->servicio = new Servicios();
parent::setUp();
}
示例13: setUp
public function setUp()
{
$this->getFixtureManager()->basePath = Yii::getPathOfAlias('application.modules.pages.tests.fixtures');
parent::setUp();
}
示例14: setUp
protected function setUp()
{
parent::setUp();
$this->getRequestUrl('http://localhost/');
}
示例15: setUp
public function setUp()
{
parent::setUp();
$this->client = $this->createClient();
}