コード例 #1
0
 /**
  * Test setup
  *
  * Load an instance of file.ini
  * Assigns DB parameters for cluster
  **/
 public function setUp()
 {
     parent::setUp();
     // We need to clear the existing handler if it was loaded before the INI
     // settings changes
     eZClusterFileHandler::resetHandler();
     unset($GLOBALS['eZClusterInfo']);
     // Load database parameters for cluster
     // The same DSN than the relational database is used
     $dsn = ezpTestRunner::dsn()->parts;
     switch ($dsn['phptype']) {
         case 'mysql':
         case 'mysqli':
             $backend = 'eZDBFileHandlerMysqliBackend';
             break;
         case 'postgresql':
             $backend = 'eZDBFileHandlerPostgresqlBackend';
             break;
         default:
             $this->markTestSkipped("Unsupported database type '{$dsn['phptype']}'");
     }
     ezpINIHelper::setINISetting('file.ini', 'ClusteringSettings', 'FileHandler', 'eZDBFileHandler');
     ezpINIHelper::setINISetting('file.ini', 'ClusteringSettings', 'DBHost', $dsn['host']);
     ezpINIHelper::setINISetting('file.ini', 'ClusteringSettings', 'DBPort', $dsn['port']);
     ezpINIHelper::setINISetting('file.ini', 'ClusteringSettings', 'DBSocket', $dsn['socket']);
     ezpINIHelper::setINISetting('file.ini', 'ClusteringSettings', 'DBName', $dsn['database']);
     ezpINIHelper::setINISetting('file.ini', 'ClusteringSettings', 'DBUser', $dsn['user']);
     ezpINIHelper::setINISetting('file.ini', 'ClusteringSettings', 'DBPassword', $dsn['password']);
     ezpINIHelper::setINISetting('file.ini', 'ClusteringSettings', 'DBBackend', $backend);
     // ezpTestDatabaseHelper::insertSqlData( $this->sharedFixture, $this->sqlFiles );
     $this->db = $this->sharedFixture;
 }
コード例 #2
0
 /**
  * Test setup
  *
  * Load an instance of file.ini
  **/
 public function setUp()
 {
     parent::setUp();
     // We need to clear the existing handler if it was loaded before the INI
     // settings changes
     eZClusterFileHandler::resetHandler();
     // Load database parameters for cluster
     // The same DSN than the relational database is used
     ezpINIHelper::setINISetting('file.ini', 'ClusteringSettings', 'FileHandler', $this->clusterClass);
 }
コード例 #3
0
 public function setUp()
 {
     parent::setUp();
     $this->previousFileHandler = eZINI::instance('file.ini')->variable('ClusteringSettings', 'FileHandler');
     $this->DFSPath = eZDFSFileHandlerTest::getDfsPath();
     eZDFSFileHandlerTest::setUpDatabase();
     if (!file_exists($this->DFSPath)) {
         eZDir::doMkdir($this->DFSPath, 0755);
         $this->haveToRemoveDFSPath = true;
     }
     $this->db = $this->sharedFixture;
 }
コード例 #4
0
 /**
  * Test setup
  *
  * Load an instance of file.ini
  **/
 public function setUp()
 {
     $this->markTestSkipped("Tests skipped until eZFS2 becomes more stable");
     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 $this->clusterClass) {
         unset($GLOBALS['eZClusterFileHandler_chosen_handler']);
     }
     // Load database parameters for cluster
     // The same DSN than the relational database is used
     ezpINIHelper::setINISetting('file.ini', 'ClusteringSettings', 'FileHandler', $this->clusterClass);
 }