Esempio n. 1
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');
 }
Esempio n. 2
0
 /**
  * @covers String::titleCase
  */
 public function testTitleCase()
 {
     AppLocale::setTranslations(array('common.titleSmallWords' => 'is a'));
     $originalTitle = 'AND This IS A TEST title';
     self::assertEquals('And This is a Test Title', String::titleCase($originalTitle));
 }