当前位置: 首页>>代码示例>>PHP>>正文


PHP WebTestCase::setUp方法代码示例

本文整理汇总了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);
 }
开发者ID:vasiliy-pdk,项目名称:aes,代码行数:7,代码来源:ElectionRegistrationTest.php

示例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);
         }
     }
 }
开发者ID:pkp,项目名称:ojs,代码行数:32,代码来源:FunctionalMostReadBlockPluginTestCase.php

示例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');
 }
开发者ID:revollat,项目名称:cmf-sandbox,代码行数:8,代码来源:AdminTest.php

示例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);
 }
开发者ID:vasiliy-pdk,项目名称:aes,代码行数:10,代码来源:RegistrationTest.php

示例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');
 }
开发者ID:stpncpe,项目名称:cbdbx,代码行数:15,代码来源:UserValidationTest.php

示例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();
 }
开发者ID:mosvits,项目名称:ojs,代码行数:23,代码来源:FunctionalDoiPubIdPluginTestCase.php

示例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();
 }
开发者ID:reconciler,项目名称:ojs,代码行数:23,代码来源:FunctionalUrnPubIdPluginTest.php

示例8: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->deleteTmpDir('ORM');
 }
开发者ID:soeren-helbig,项目名称:FOSElasticaBundle,代码行数:5,代码来源:IndexableCallbackTest.php

示例9: setUp

 /**
  * @see WebTestCase::setUp()
  */
 protected function setUp()
 {
     parent::setUp();
     $this->editorBasePath = $this->baseUrl . '/index.php/lucene-test/editor/';
 }
开发者ID:utslibrary,项目名称:ojs,代码行数:8,代码来源:FunctionalEditingBaseTestCase.inc.php

示例10: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->orderFixture = $this->manager->loadFixture('sales/quote');
 }
开发者ID:jameshalsall,项目名称:Manager,代码行数:5,代码来源:OrderTest.php

示例11: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->addressFixture = $this->manager->loadFixture('customer/address');
 }
开发者ID:jameshalsall,项目名称:Manager,代码行数:5,代码来源:AddressTest.php

示例12: setUp

 public function setUp()
 {
     $this->servicio = new Servicios();
     parent::setUp();
 }
开发者ID:cicb,项目名称:tpc,代码行数:5,代码来源:ServiciosTest.php

示例13: setUp

 public function setUp()
 {
     $this->getFixtureManager()->basePath = Yii::getPathOfAlias('application.modules.pages.tests.fixtures');
     parent::setUp();
 }
开发者ID:kolbensky,项目名称:rybolove,代码行数:5,代码来源:PagesWebTest.php

示例14: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->getRequestUrl('http://localhost/');
 }
开发者ID:pixel418,项目名称:staq,代码行数:5,代码来源:ServerTest.php

示例15: setUp

 public function setUp()
 {
     parent::setUp();
     $this->client = $this->createClient();
 }
开发者ID:detain,项目名称:PayumServer,代码行数:5,代码来源:ClientTestCase.php


注:本文中的WebTestCase::setUp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。