setUp() protected method

This mainly sets the base URL for the test application.
protected setUp ( )
Exemplo n.º 1
0
 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);
         }
     }
 }
Exemplo n.º 3
0
 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');
 }
Exemplo n.º 4
0
 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);
 }
Exemplo n.º 5
0
 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');
 }
 /**
  * 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();
 }
 /**
  * @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();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->deleteTmpDir('ORM');
 }
 /**
  * @see WebTestCase::setUp()
  */
 protected function setUp()
 {
     parent::setUp();
     $this->editorBasePath = $this->baseUrl . '/index.php/lucene-test/editor/';
 }
Exemplo n.º 10
0
 protected function setUp()
 {
     parent::setUp();
     $this->orderFixture = $this->manager->loadFixture('sales/quote');
 }
Exemplo n.º 11
0
 protected function setUp()
 {
     parent::setUp();
     $this->addressFixture = $this->manager->loadFixture('customer/address');
 }
Exemplo n.º 12
0
 protected function setUp()
 {
     parent::setUp();
     $this->deleteTmpDir('SessionTest');
 }
Exemplo n.º 13
0
 public function setUp()
 {
     $this->servicio = new Servicios();
     parent::setUp();
 }
Exemplo n.º 14
0
 protected function setUp()
 {
     parent::setUp();
     $this->deleteTmpDir('Serializer');
 }
Exemplo n.º 15
0
 public function setUp()
 {
     $this->getFixtureManager()->basePath = Yii::getPathOfAlias('application.modules.pages.tests.fixtures');
     parent::setUp();
 }
Exemplo n.º 16
0
 protected function setUp()
 {
     parent::setUp();
     $this->getRequestUrl('http://localhost/');
 }
Exemplo n.º 17
0
 public function setUp()
 {
     parent::setUp();
     $this->client = $this->createClient();
 }
Exemplo n.º 18
0
 public function setUp()
 {
     parent::setUp();
     $this->old_include_path = set_include_path('../conf' . PATH_SEPARATOR . get_include_path());
 }
Exemplo n.º 19
0
 public function setUp()
 {
     parent::setUp();
     $this->base_url .= '/api/games';
 }
Exemplo n.º 20
0
 function setUp()
 {
     $this->addHeader("User-Agent:" . USER_AGENT);
     parent::setUp();
 }
Exemplo n.º 21
0
 protected function setUp()
 {
     parent::setUp();
     $this->getRequestUrl('http://localhost/coco');
     $app = \Staq\App::create($this->projectNamespace)->setPlatform('local');
 }
Exemplo n.º 22
0
 protected function setUp()
 {
     parent::setUp();
 }
Exemplo n.º 23
0
 protected function setUp()
 {
     parent::setUp();
     $this->productFixture = $this->manager->loadFixture('catalog/product');
 }
Exemplo n.º 24
0
 public function setUp()
 {
     parent::setUp();
     self::$walletName = 'alice_test';
     self::$walletSamplesBaseUrl = self::baseUrl() . basename(__DIR__) . '/';
 }
 protected function setUp()
 {
     parent::setUp();
     $this->deleteTmpDir('StandardFormLogin');
 }
Exemplo n.º 26
0
 protected function setUp()
 {
     $this->client = self::createClient(array('test_case' => 'Basic', 'root_config' => 'config.yml'), array('PHP_AUTH_USER' => 'user', 'PHP_AUTH_PW' => 'user'));
     parent::setUp();
 }