*/
class Horde_Db_Adapter_Pdo_PgsqlSuite extends PHPUnit_Framework_TestSuite
{
+ public static $conn = null;
+
public static function suite()
{
$suite = new self('Horde Framework - Horde_Db - PDO-PostgreSQL Adapter');
$skip = true;
if (extension_loaded('pdo') && in_array('pgsql', PDO::getAvailableDrivers())) {
try {
- list($conn,) = $suite->getConnection();
+ self::$conn = $suite->getConnection();
$skip = false;
- $conn->disconnect();
} catch (Exception $e) {}
}
public function getConnection()
{
+ if (!is_null(self::$conn)) { return self::$conn; }
+
if (!class_exists('CacheMock', false)) eval('class CacheMock { function get($key) { return $this->$key; } function set($key, $val) { $this->$key = $val; } } ?>');
$cache = new CacheMock;
list($this->_conn,) = $this->sharedFixture->getConnection();
}
- protected function tearDown()
- {
- // close connection
- $this->_conn->disconnect();
- }
-
-
public function testConstruct()
{
$col = new Horde_Db_Adapter_Base_ColumnDefinition(
list($this->_conn,) = $this->sharedFixture->getConnection();
}
- protected function tearDown()
- {
- // close connection
- $this->_conn->disconnect();
- }
-
/*##########################################################################
# Public methods