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');
 }
예제 #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();
 }
 /**
  * @copydoc PHPUnit_Framework_TestCase::tearDown()
  */
 protected function tearDown()
 {
     parent::tearDown();
     $affectedTables = $this->getAffectedTables();
     if (is_array($affectedTables)) {
         PKPTestHelper::restoreTables($this->getAffectedTables(), $this);
     } elseif ($affectedTables === PKP_TEST_ENTIRE_DB) {
         PKPTestHelper::restoreDB($this);
     }
     // Switch xdebug screaming back on.
     PKPTestHelper::xdebugScream(true);
 }
예제 #5
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();
 }
예제 #6
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();
     }
 }
 protected function setUp()
 {
     parent::setUp();
     $this->form = new Form('some template');
 }
예제 #9
0
 /**
  * @see PKPTestCase::tearDown()
  */
 protected function tearDown()
 {
     HookRegistry::resetCalledHooks();
     parent::tearDown();
 }
 public function tearDown()
 {
     // Delete the test citations.
     $this->citationDao->deleteObjectsByAssocId($this->assocType, $this->assocId);
     parent::tearDown();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->metadataDescription = new MetadataDescription('lib.pkp.tests.classes.metadata.TestSchema', ASSOC_TYPE_CITATION);
 }
 protected function setUp()
 {
     parent::setUp();
     $this->dataObject = new DataObject();
 }
예제 #13
0
 /**
  * @see PKPTestCase::setUp()
  */
 protected function setUp()
 {
     parent::setUp();
     // Instantiate the class for testing.
     $this->embeddedServer = new EmbeddedServer();
 }
 protected function setUp()
 {
     parent::setUp();
     $this->notificationMgr = new PKPNotificationManager();
 }