protected function setUp()
 {
     parent::setUp();
     $this->form = new Form('some template');
     $this->subfieldValidation = array($this, 'userFunctionForSubfields');
     $this->localeFieldValidation = array($this, 'userFunctionForLocaleFields');
 }
 public function setUp()
 {
     parent::setUp();
     HookRegistry::rememberCalledHooks();
     $this->request = new PKPRequest();
     // Save the config data for testTrustXForwardedFor tests
     $this->getRemoteAddrTestConfigData = Registry::get('configData');
 }
Exemple #3
0
 protected function setUp()
 {
     // Retrieve and check configuration.
     $medraPassword = Config::getVar('debug', 'webtest_medra_pw');
     if (empty($medraPassword)) {
         $this->markTestSkipped('Please set webtest_medra_pw in your config.php\'s ' . '[debug] section to the password of your Medra test account.');
     }
     $this->ws = new MedraWebservice(MEDRA_WS_ENDPOINT_DEV, 'TEST_OJS', $medraPassword);
     parent::setUp();
 }
Exemple #4
0
 /**
  * @see PKPTestCase::setUp()
  */
 protected function setUp()
 {
     parent::setUp();
     HookRegistry::rememberCalledHooks();
     // Prepare the mock environment for this test.
     $this->registerMockArticleSearchDAO();
     $this->registerMockArticleDAO();
     $this->registerMockPublishedArticleDAO();
     $this->registerMockIssueDAO();
     $this->registerMockJournalDAO();
     $this->registerMockSectionDAO();
 }
 /**
  * @copydoc PHPUnit_Framework_TestCase::setUp()
  */
 protected function setUp()
 {
     // Switch off xdebug screaming (there are
     // errors in adodb...).
     PKPTestHelper::xdebugScream(false);
     // Make sure we have a db connection (some tests
     // might close it and that affects the next ones).
     DBConnection::getInstance()->reconnect();
     // Backup affected tables.
     $affectedTables = $this->getAffectedTables();
     if (is_array($affectedTables)) {
         PKPTestHelper::backupTables($affectedTables, $this);
     }
     parent::setUp();
 }
 /**
  * @copydoc PKPTestCase::setUp()
  */
 protected function setUp()
 {
     parent::setUp();
     $application = PKPApplication::getApplication();
     $_SERVER['REQUEST_METHOD'] = 'GET';
     $request = $application->getRequest();
     if (is_null($request->getRouter())) {
         $router = new PKPRouter();
         $request->setRouter($router);
     }
     // Instantiate the citation DAO and make sure we have no left-overs
     // from previous unsuccessful tests.
     $this->citationDao = DAORegistry::getDAO('CitationDAO');
     $this->citationDao->deleteObjectsByAssocId($this->assocType, $this->assocId);
 }
Exemple #7
0
 /**
  * @see PHPUnit_Framework_TestCase::setUp()
  */
 protected function setUp()
 {
     parent::setUp();
     // Mock application object without calling its constructor.
     $mockApplication = $this->getMock('Application', array('getContextDepth', 'getContextList'), array(), '', false);
     Registry::set('application', $mockApplication);
     $nullVar = null;
     Registry::set('dispatcher', $nullVar);
     // Set up the getContextDepth() method
     $mockApplication->expects($this->any())->method('getContextDepth')->will($this->returnValue(2));
     // Set up the getContextList() method
     $mockApplication->expects($this->any())->method('getContextList')->will($this->returnValue(array('firstContext', 'secondContext')));
     $this->dispatcher = $mockApplication->getDispatcher();
     // this also adds the component router
     $this->dispatcher->addRouterName('lib.pkp.classes.core.PKPPageRouter', 'page');
     $this->request = new PKPRequest();
 }
Exemple #8
0
 /**
  * @see PKPTestCase::setUp()
  */
 protected function setUp()
 {
     parent::setUp();
     HookRegistry::rememberCalledHooks();
     // Prepare the mock environment for this test.
     $this->registerMockArticleSearchDAO();
     $this->registerMockArticleDAO();
     $this->registerMockPublishedArticleDAO();
     $this->registerMockIssueDAO();
     $this->registerMockJournalDAO();
     $this->registerMockSectionDAO();
     $application = PKPApplication::getApplication();
     $request = $application->getRequest();
     if (is_null($request->getRouter())) {
         $router = new PKPRouter();
         $request->setRouter($router);
     }
 }
Exemple #9
0
 /**
  * @see PKPTestCase::setUp()
  */
 protected function setUp()
 {
     parent::setUp();
     // We need a router for URL generation.
     $application = PKPApplication::getApplication();
     $_SERVER['REQUEST_METHOD'] = 'GET';
     $request = $application->getRequest();
     if (!is_a($request->getRouter(), 'PKPRouter')) {
         $router = new PageRouter();
         $router->setApplication($application);
         $request->setRouter($router);
     }
     // Add the indexing state as setting.
     HookRegistry::register('articledao::getAdditionalFieldNames', array($this, 'callbackAdditionalFieldNames'));
     // Set translations. This must be done early
     // as these translations will be saved statically
     // during the first request.
     AppLocale::setTranslations(array('search.operator.not' => 'nicht', 'search.operator.and' => 'und', 'search.operator.or' => 'oder'));
     // Instantiate our web service for testing.
     $this->solrWebService = new SolrWebService('http://localhost:8983/solr/ojs/search', 'admin', 'please change', 'test-inst');
 }
 protected function setUp()
 {
     $this->cacheManager = CacheManager::getManager();
     $this->cacheMisses = 0;
     if (!is_writable($this->cacheManager->getFileCachePath())) {
         $this->markTestSkipped('File cache path not writable.');
     } else {
         parent::setUp();
         $this->cacheManager->flush();
     }
 }
 /**
  * @see PKPTestCase::setUp()
  */
 protected function setUp()
 {
     parent::setUp();
     HookRegistry::rememberCalledHooks();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->form = new Form('some template');
 }
 protected function setUp()
 {
     parent::setUp();
     HookRegistry::rememberCalledHooks();
     $this->router = new PKPRouter();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->metadataDescription = new MetadataDescription('lib.pkp.tests.classes.metadata.TestSchema', ASSOC_TYPE_CITATION);
 }
 protected function setUp()
 {
     parent::setUp();
     $this->notificationMgr = new PKPNotificationManager();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->dataObject = new DataObject();
 }
Exemple #17
0
 /**
  * @see PKPTestCase::setUp()
  */
 protected function setUp()
 {
     parent::setUp();
     // Instantiate the class for testing.
     $this->embeddedServer = new EmbeddedServer();
 }