Exemplo n.º 1
0
 /**
  * @see PHPUnit_Framework_TestCase::setUp()
  */
 protected function setUp($doiPrefix)
 {
     parent::setUp();
     $indexPage = $this->pages['index'];
     $this->pages += array('all' => $indexPage . '/all', 'issues' => $indexPage . '/issues', 'articles' => $indexPage . '/articles', 'galleys' => $indexPage . '/galleys');
     // Store initial journal configuration.
     $journalDao = DAORegistry::getDAO('JournalDAO');
     /* @var $journalDao JournalDAO */
     $journal = $journalDao->getById(1);
     $this->initialJournalSettings = array('publisherInstitution' => $journal->getSetting('publisherInstitution'), 'supportEmail' => $journal->getSetting('supportEmail'));
     // Store initial DOI settings.
     $pubIdPlugins = PluginRegistry::loadCategory('pubIds');
     $doiPlugin = $pubIdPlugins['DOIPubIdPlugin'];
     $this->initialDoiSettings = array('enabled' => $doiPlugin->getSetting(1, 'enabled'), 'doiPrefix' => $doiPlugin->getSetting(1, 'doiPrefix'), 'doiSuffix' => $doiPlugin->getSetting(1, 'doiSuffix'));
     // Reset DOI prefix and all DOIs.
     $this->doiPrefix = $doiPrefix;
     $doiPlugin->updateSetting(1, 'enabled', true);
     $doiPlugin->updateSetting(1, 'doiPrefix', $doiPrefix);
     $doiPlugin->updateSetting(1, 'doiSuffix', 'default');
     PKPTestHelper::xdebugScream(false);
     $journalDao->deleteAllPubIds(1, 'doi');
     PKPTestHelper::xdebugScream(true);
     // Store initial plug-in configuration.
     $settingsDao = DAORegistry::getDAO('PluginSettingsDAO');
     /* @var $settingsDao PluginSettingsDAO */
     $this->initialPluginSettings = array();
     foreach ($this->defaultPluginSettings as $settingName => $settingValue) {
         $this->initialPluginSettings[] = $settingsDao->getSetting(1, $this->pluginId . 'exportplugin', $settingName);
     }
 }
 /**
  * @see WebTestCase::setUp()
  */
 protected function setUp()
 {
     parent::setUp();
     $application = PKPApplication::getApplication();
     $request = $application->getRequest();
     if (is_null($request->getRouter())) {
         $router = new PKPRouter();
         $request->setRouter($router);
     }
 }