/** * Test case setup */ public function setUp() { parent::setUp(); $this->wildcard = new eZURLWildcard(array('source_url' => 'MyRootURL', 'destination_url' => '/', 'type' => eZURLWildcard::TYPE_DIRECT)); $this->wildcard->store(); eZURLWildcard::expireCache(); }
/** * Test setup * * Load an instance of file.ini * Assigns DB parameters for cluster **/ public function setUp() { if (!$this->sharedFixture instanceof eZMySQLDB) { self::markTestSkipped("Not using mysql interface, skipping"); } parent::setUp(); // We need to clear the existing handler if it was loaded before the INI // settings changes if (isset($GLOBALS['eZClusterFileHandler_chosen_handler']) and !$GLOBALS['eZClusterFileHandler_chosen_handler'] instanceof eZDFSFileHandler) { unset($GLOBALS['eZClusterFileHandler_chosen_handler']); } // Load database parameters for cluster // The same DSN than the relational database is used $fileINI = eZINI::instance('file.ini'); $this->previousFileHandler = $fileINI->variable('ClusteringSettings', 'FileHandler'); $fileINI->setVariable('ClusteringSettings', 'FileHandler', 'eZDFSFileHandler'); $dsn = ezpTestRunner::dsn()->parts; $fileINI->setVariable('eZDFSClusteringSettings', 'DBHost', $dsn['host']); $fileINI->setVariable('eZDFSClusteringSettings', 'DBPort', $dsn['port']); $fileINI->setVariable('eZDFSClusteringSettings', 'DBSocket', $dsn['socket']); $fileINI->setVariable('eZDFSClusteringSettings', 'DBName', $dsn['database']); $fileINI->setVariable('eZDFSClusteringSettings', 'DBUser', $dsn['user']); $fileINI->setVariable('eZDFSClusteringSettings', 'DBPassword', $dsn['password']); $fileINI->setVariable('eZDFSClusteringSettings', 'MountPointPath', $this->DFSPath); if (!file_exists($this->DFSPath)) { eZDir::doMkdir($this->DFSPath, 0755); $this->haveToRemoveDFSPath = true; } ezpTestDatabaseHelper::insertSqlData($this->sharedFixture, $this->sqlFiles); $this->db = $this->sharedFixture; }
protected function setUp() { if (!in_array(ezpTestRunner::dsn()->dbsyntax, array('mysql', 'mysqli'))) { self::markTestSkipped("Not running MySQL nor MysQLi, skipping"); } parent::setUp(); }
public function setUp() { parent::setUp(); $this->xxx = eZContentLanguage::addLanguage('xxx-XX', 'XXXX'); ezpINIHelper::setINISetting('site.ini', 'RegionalSettings', 'SiteLanguageList', array('xxx-XX', 'eng-GB')); eZContentLanguage::clearPrioritizedLanguages(); }
public function setUp() { parent::setUp(); $this->class = new ezpClass('eZContentClassRegression', 'eZContentClassRegression', '<name>'); $this->class->add('Name', 'name'); $this->class->store(); }
public function setUp() { parent::setUp(); $this->norskLanguage = eZContentLanguage::addLanguage("nor-NO", "Norsk"); $this->englishLanguage = eZContentLanguage::fetchByLocale("eng-GB"); $this->frenchLanguage = eZContentLanguage::addLanguage("fre-FR", "Français"); }
/** * Test case setup * Changes INI settings that affect eZURLWildcard to known and predictable * values */ public function setUp() { parent::setUp(); $this->wildcardRow[0] = array( 'source_url' => 'test/*', 'destination_url' => '/', 'type' => eZURLWildcard::TYPE_DIRECT, ); $this->wildcards[0] = new eZURLWildcard( $this->wildcardRow[0] ); $this->generatedWildcards = 5; // Creating some wildcards for ( $i = 0; $i < $this->generatedWildcards; ++$i ) { $source = "test" . ( $i % 2 ? 'Odd' : 'Pair' ) . "/$i/*"; $this->wildcardObjects[$source] = self::createWildcard( $source, '/', eZURLWildcard::TYPE_DIRECT ); } // Creating some wildcards which will be used for translate tests $this->wildcardObjects["foobar/*/*"] = self::createWildcard( "foobar/*/*", '/', eZURLWildcard::TYPE_DIRECT ); $this->wildcardObjects["testTranslate1/*/*"] = self::createWildcard( "testTranslate1/*/*", 'foobar/{1}/{2}', eZURLWildcard::TYPE_DIRECT ); $this->wildcardObjects["testTranslate2/*/abc"] = self::createWildcard( "testTranslate2/*/abc", 'foobar/{1}', eZURLWildcard::TYPE_FORWARD ); $this->wildcardObjects["test/single-page"] = self::createWildcard( "test/single-page", 'foo/bar', eZURLWildcard::TYPE_FORWARD ); eZURLWildcard::expireCache(); }
public function setUp() { parent::setUp(); $this->userLogin = uniqid( '', true ); $this->userEmail = "{$this->userLogin}@ez.no"; $ini = eZINI::instance(); $params = array( 'creator_id' => 14, 'class_identifier' => 'user', 'parent_node_id' => $ini->variable( 'UserSettings', 'DefaultUserPlacement' ), 'attributes' => array( 'first_name' => 'foo', 'last_name' => 'bar' ), ); $contentObject = eZContentFunctions::createAndPublishObject( $params ); if( !$contentObject instanceof eZContentObject ) { die( 'Impossible to create user object' ); } $this->userObject = $contentObject; }
public function setUp() { parent::setUp(); self::$qb = new ezfeZPSolrQueryBuilderTester(); self::$findINI = eZINI::instance('ezfind.ini'); self::$siteINI = eZINI::instance('site.ini'); }
public function setUp() { $className = 'eZSolrMultiCoreBase'; if (!class_exists($className)) { $this->markTestSkipped("The class '{$className}' doesn't exist."); } parent::setUp(); }
public function setUp() { // Enabled delayed indexing in order not to index support objects // ( the ones used for testing ezfSolrDocumentFieldObjectRelation::getData() for instance ) $siteINI = eZINI::instance('site.ini'); $siteINI->setVariable('SearchSettings', 'DelayedIndexing', 'enabled'); parent::setUp(); }
/** * setUp(): * - creates a PAEX object for the admin user **/ public function setUp() { parent::setUp(); $this->paexTime = time(); $row = array('contentobject_id' => 14, 'passwordvalidationregexp' => '', 'passwordlifetime' => 3, 'expirationnotification' => eZPaEx::NOT_DEFINED, 'password_last_updated' => $this->paexTime, 'updatechildren' => 0, 'expirationnotification_sent' => 0); $this->paex = new eZPaEx($row); $this->paexINI = eZINI::instance('mbpaex.ini'); }
public function setUp() { parent::setUp(); $imageClass = new ezpClass(self::CLASS_IDENTIFIER, self::CLASS_IDENTIFIER, "<name>"); $imageClass->add("Name", "name", "ezstring"); $imageClass->add("Image", "image", "ezimage"); $imageClass->store(); }
public function setUp() { // Verify that the clusterClass for each implementation is properly defined if ($this->clusterClass === false) { $this->markTestSkipped("Test class " . get_class($this) . " does not provide the clusterClass property"); } return parent::setUp(); }
public function setUp() { parent::setUp(); $this->language = eZContentLanguage::addLanguage("nor-NO", "Norsk"); // Make sure all tests are done using utf-8 as charset $this->charset = $GLOBALS['eZTextCodecInternalCharsetReal']; $GLOBALS['eZTextCodecInternalCharsetReal'] = 'utf-8'; }
protected function setUp() { if (ezpTestRunner::dsn()->dbsyntax !== "postgresql") { self::markTestSkipped("Not running PostgresSQL, skipping"); } parent::setUp(); ezpTestDatabaseHelper::clean($this->sharedFixture); }
public function setUp() { parent::setUp(); $this->article = new ezpObject("article", 2, eZUser::fetchByName('anonymous')->attribute('contentobject_id')); $this->article->title = "Article for " . __CLASS__; $this->article->publish(); $this->article->addTranslation("nor-NO", array("title" => "Norsk title of article for " . __CLASS__)); }
protected function setUp() { if (!in_array(ezpTestRunner::dsn()->dbsyntax, array('mysql', 'mysqli'))) { self::markTestSkipped("Not running MySQL nor MysQLi, skipping"); } parent::setUp(); // clean up the database so that the tests are independant from the ezp database ezpTestDatabaseHelper::clean($this->sharedFixture); }
public function setUp() { parent::setUp(); $currentUser = eZUser::currentUser(); $anonymousID = eZUser::anonymousId(); if ($currentUser->isRegistered()) { self::$previousUserID = $currentUser->attribute('contentobject_id'); eZUser::setCurrentlyLoggedInUser(eZUser::fetch($anonymousID), $anonymousID); } }
public function setUp() { parent::setUp(); $this->testURI = '/admin/ping'; $this->postParams = array('foo' => 'bar'); $this->nonReachableSolr = 'http://10.255.255.1/solr'; ezpINIHelper::setINISetting('solr.ini', 'SolrBase', 'ConnectionTimeout', 2); ezpINIHelper::setINISetting('solr.ini', 'SolrBase', 'ProcessMaxRetries', 2); $this->solrINI = eZINI::instance('solr.ini'); }
/** * Called by PHPUnit before each test. */ public function setUp() { // Call the setUp() in ezpDatabaseTestCase parent::setUp(); // Modify these values for your own $GLOBALS['ezp_username'] = '******'; $GLOBALS['ezp_password'] = '******'; $GLOBALS['ezp_server'] = 'localhost:8080/ezpublish/index.php/eng'; $GLOBALS['ezp_admin_email'] = '*****@*****.**'; $GLOBALS['test_data_folder'] = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'ezrss' . DIRECTORY_SEPARATOR; }
/** * Test case setup * Changes INI settings that affect eZURLWildcard to known and predictable * values */ public function setUp() { parent::setUp(); $ini = eZINI::instance('site.ini'); $this->iniBackup['implementationBackup'] = $ini->variable('DatabaseSettings', 'DatabaseImplementation'); $this->iniBackup['serverBackup'] = $ini->variable('DatabaseSettings', 'Server'); $this->iniBackup['databaseBackup'] = $ini->variable('DatabaseSettings', 'Database'); $ini->setVariable('DatabaseSettings', 'DatabaseImplementation', 'ezmysqli'); $ini->setVariable('DatabaseSettings', 'Server', 'localhost'); $ini->setVariable('DatabaseSettings', 'Database', 'testdb'); }
public function setUp() { parent::setUp(); $adminObjectID = eZUser::fetchByName('admin')->attribute('contentobject_id'); // Create approval workflow and set up pre publish trigger $this->workflow = $this->createApprovalWorkFlow($adminObjectID); $this->trigger = $this->createTrigger($this->workflow->attribute('id')); // Log in as a user who needs approval. $this->currentUser = eZUser::currentUser(); $anonymous = eZUser::fetchByName('anonymous'); eZUser::setCurrentlyLoggedInUser($anonymous, $anonymous->attribute('contentobject_id')); }
public function setUp() { parent::setUp(); eZINI::instance('ezfind.ini')->loadCache(true); eZINI::instance('solr.ini')->loadCache(true); ezpINIHelper::setINISetting('site.ini', 'SearchSettings', 'AllowEmptySearch', 'enabled'); ezpINIHelper::setINISetting('site.ini', 'RegionalSettings', 'SiteLanguageList', array('eng-GB')); $this->solrSearch = new eZSolr(); $this->testObj = eZContentObject::fetchByNodeID(2); $this->solrSearch->addObject($this->testObj); $this->fetchParams = array('SearchOffset' => 0, 'SearchLimit' => 10, 'Facet' => null, 'SortBy' => null, 'Filter' => null, 'SearchContentClassID' => null, 'SearchSectionID' => null, 'SearchSubTreeArray' => null, 'AsObjects' => null, 'SpellCheck' => null, 'IgnoreVisibility' => null, 'Limitation' => null, 'BoostFunctions' => null, 'QueryHandler' => 'ezpublish', 'EnableElevation' => null, 'ForceElevation' => null, 'SearchDate' => null, 'DistributedSearch' => null, 'FieldsToReturn' => null); }
public function setUp() { parent::setUp(); $this->policy = eZPolicy::createNew( 1, array( 'ModuleName' => 'foo', 'FunctionName' => 'bar' ) ); eZPolicyLimitation::createNew( $this->policy->attribute( 'id' ), 'Owner' ); }
/** * Setup: * - creates a new content class with the tested datatype * - instanciates a content object of that class with the default dataset */ public function setUp() { // create a content class with this datatype // @todo Add naming pattern handling parent::setUp(); $contentClassName = "Datatype {$this->datatype} test"; $contentClassIdentifier = "datatype_{$this->datatype}_test"; $this->attributeIdentifier = "{$this->datatype}_test"; $this->class = new ezpClass($contentClassName, $contentClassIdentifier, '<name>'); $this->class->add('Title', 'title', 'ezstring'); $this->class->add("Test {$this->datatype}", $this->attributeIdentifier, $this->datatype); $this->class->store(); }
/** * Called by PHPUnit before each test. */ public function setUp() { // Call the setUp() in ezpDatabaseTestCase parent::setUp(); // get server url $this->ezp_server = eZINI::instance()->variable('SiteSettings', 'SiteURL'); // login admin $this->currentUser = eZUser::currentUser(); $admin = eZUser::fetchByName('admin'); eZUser::setCurrentlyLoggedInUser($admin, $admin->attribute('contentobject_id')); $this->ezp_admin_id = $admin->attribute('contentobject_id'); $this->ezp_admin_email = $admin->attribute('email'); $this->test_data_folder = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'ezrss' . DIRECTORY_SEPARATOR; }
public function setUp() { parent::setUp(); // Set HashType to md5_password (to update the password_hash in the ezuser table) ezpINIHelper::setINISetting('site.ini', 'UserSettings', 'HashType', 'md5_password'); ezpINIHelper::setINISetting('site.ini', 'UserSettings', 'UpdateHash', 'true'); ezpINIHelper::setINISetting('site.ini', 'UserSettings', 'AuthenticateMatch', 'login;email'); // Login the user $userClass = eZUserLoginHandler::instance('standard'); $user = $userClass->loginUser($this->username, $this->password); // Verify that the username and password were accepted if (!$user instanceof eZUser) { self::markTestSkipped("User {$this->username} is not in database."); } }
/** * Called by PHPUnit before each test. */ public function setUp() { // Call the setUp() in ezpDatabaseTestCase parent::setUp(); // get server url $this->ezp_server = eZINI::instance()->variable('SiteSettings', 'SiteURL'); // login admin $this->currentUser = eZUser::currentUser(); $admin = eZUser::fetchByName('admin'); eZUser::setCurrentlyLoggedInUser($admin, $admin->attribute('contentobject_id')); $this->ezp_admin_id = $admin->attribute('contentobject_id'); $this->ezp_admin_email = $admin->attribute('email'); $this->test_data_folder = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'ezrss' . DIRECTORY_SEPARATOR; $this->remote_id_map = array('894c0959925a6ac47c915b7c8fb6376c', '935f192b93cbadbbf93d7b031bdceb70'); }
public function setUp() { parent::setUp(); ezpINIHelper::setINISetting('site.ini', 'SearchSettings', 'AllowEmptySearch', 'enabled'); ezpINIHelper::setINISetting('site.ini', 'RegionalSettings', 'SiteLanguageList', array('eng-GB')); $this->findINI = eZINI::instance('ezfind.ini'); $this->findINI->loadCache(true); $this->solrSearch = new eZSolr(); $this->object = new ezpObject('folder', 2); $this->object->name = 'foo'; $this->object->publish(); $this->object->addNode(43); // Add a location under Media node $this->solrSearch->addObject($this->object->object); }