예제 #1
0
 /**
  * Prepares the environment before running a test.
  */
 public function setUp()
 {
     // Backup DBAL configuration
     $this->dbalConfig = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['dbal'];
     // Backup database connection
     $this->db = $GLOBALS['TYPO3_DB'];
     // Reconfigure DBAL to use Oracle
     require 'fixtures/oci8.config.php';
     $className = self::buildAccessibleProxy('ux_t3lib_db');
     $GLOBALS['TYPO3_DB'] = new $className();
     $parserClassName = self::buildAccessibleProxy('ux_t3lib_sqlparser');
     $GLOBALS['TYPO3_DB']->SQLparser = new $parserClassName();
     $this->assertFalse($GLOBALS['TYPO3_DB']->isConnected());
     // Initialize a fake Oracle connection
     FakeDbConnection::connect($GLOBALS['TYPO3_DB'], 'oci8');
     $this->assertTrue($GLOBALS['TYPO3_DB']->isConnected());
 }
 /**
  * Prepares the environment before running a test.
  */
 public function setUp()
 {
     // Backup DBAL configuration
     $this->dbalConfig = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['dbal'];
     // Backup database connection
     $this->db = $GLOBALS['TYPO3_DB'];
     // Reconfigure DBAL to use PostgreSQL
     require 'fixtures/postgresql.config.php';
     $className = self::buildAccessibleProxy('ux_t3lib_db');
     $GLOBALS['TYPO3_DB'] = new $className();
     $parserClassName = self::buildAccessibleProxy('ux_t3lib_sqlparser');
     $GLOBALS['TYPO3_DB']->SQLparser = new $parserClassName();
     $this->assertFalse($GLOBALS['TYPO3_DB']->isConnected());
     // Initialize a fake PostgreSQL connection (using 'postgres7' as 'postgres' is remapped to it in AdoDB)
     FakeDbConnection::connect($GLOBALS['TYPO3_DB'], 'postgres7');
     $this->assertTrue($GLOBALS['TYPO3_DB']->isConnected());
 }