Horde_Db test suite now runs with PHPUnit 3.5
authorChuck Hagenbuch <chuck@horde.org>
Sun, 3 Oct 2010 21:19:06 +0000 (17:19 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Sun, 3 Oct 2010 21:19:37 +0000 (17:19 -0400)
19 files changed:
framework/Db/test/Horde/Db/Adapter/MissingTest.php
framework/Db/test/Horde/Db/Adapter/Mysql/ColumnDefinitionTest.php
framework/Db/test/Horde/Db/Adapter/Mysql/ColumnTest.php
framework/Db/test/Horde/Db/Adapter/Mysql/TableDefinitionTest.php
framework/Db/test/Horde/Db/Adapter/MysqlSuite.php
framework/Db/test/Horde/Db/Adapter/MysqlTest.php
framework/Db/test/Horde/Db/Adapter/MysqliSuite.php
framework/Db/test/Horde/Db/Adapter/MysqliTest.php
framework/Db/test/Horde/Db/Adapter/Pdo/MysqlSuite.php
framework/Db/test/Horde/Db/Adapter/Pdo/MysqlTest.php
framework/Db/test/Horde/Db/Adapter/Pdo/PgsqlSuite.php
framework/Db/test/Horde/Db/Adapter/Pdo/PgsqlTest.php
framework/Db/test/Horde/Db/Adapter/Pdo/SqliteSuite.php
framework/Db/test/Horde/Db/Adapter/Pdo/SqliteTest.php
framework/Db/test/Horde/Db/Adapter/Postgresql/ColumnDefinitionTest.php
framework/Db/test/Horde/Db/Adapter/Postgresql/TableDefinitionTest.php
framework/Db/test/Horde/Db/Adapter/Sqlite/ColumnDefinitionTest.php
framework/Db/test/Horde/Db/Adapter/Sqlite/TableDefinitionTest.php
framework/Db/test/Horde/Db/AllTests.php

index a148815..9066ab0 100644 (file)
@@ -28,5 +28,4 @@ class Horde_Db_Adapter_MissingTest extends PHPUnit_Framework_TestCase
     {
         $this->markTestSkipped('The ' . $this->adapter . ' adapter is not available');
     }
-
 }
index 7029c8e..fffa4b0 100644 (file)
@@ -26,7 +26,7 @@ class Horde_Db_Adapter_Mysql_ColumnDefinitionTest extends PHPUnit_Framework_Test
 {
     protected function setUp()
     {
-        list($this->_conn,) = $this->sharedFixture->getConnection();
+        list($this->_conn,) = Horde_Db_AllTests::$connFactory->getConnection();
     }
 
     protected function tearDown()
index 8f85d45..f876525 100644 (file)
@@ -287,5 +287,4 @@ class Horde_Db_Adapter_Mysql_ColumnTest extends PHPUnit_Framework_TestCase
         $col = new Horde_Db_Adapter_Mysql_Column('name', '', 'blob(255)');
         $this->assertEquals('', $col->getDefault());
     }
-
 }
index b073e4b..269a2e7 100644 (file)
@@ -26,7 +26,7 @@ class Horde_Db_Adapter_Mysql_TableDefinitionTest extends PHPUnit_Framework_TestC
 {
     protected function setUp()
     {
-        list($this->_conn,) = $this->sharedFixture->getConnection();
+        list($this->_conn,) = Horde_Db_AllTests::$connFactory->getConnection();
     }
 
     protected function tearDown()
@@ -83,5 +83,4 @@ class Horde_Db_Adapter_Mysql_TableDefinitionTest extends PHPUnit_Framework_TestC
     public function testOffsetUnset()
     {
     }
-
 }
index 7844800..3363e03 100644 (file)
@@ -87,7 +87,6 @@ class Horde_Db_Adapter_MysqlSuite extends PHPUnit_Framework_TestSuite
 
     protected function setUp()
     {
-        $this->sharedFixture = $this;
+        Horde_Db_AllTests::$connFactory = $this;
     }
-
 }
index e337132..00cb5f4 100644 (file)
@@ -27,7 +27,7 @@ class Horde_Db_Adapter_MysqlTest extends PHPUnit_Framework_TestCase
     // @todo - add logger instance
     protected function setUp()
     {
-        list($this->_conn, $this->_cache) = $this->sharedFixture->getConnection();
+        list($this->_conn, $this->_cache) = Horde_Db_AllTests::$connFactory->getConnection();
 
         // clear out detritus from any previous test runs.
         $this->_dropTestTables();
@@ -1326,5 +1326,4 @@ class Horde_Db_Adapter_MysqlTest extends PHPUnit_Framework_TestCase
             if ($columns == $indexes) return $index;
         }
     }
-
 }
index 2337f4a..7b5371d 100644 (file)
@@ -85,7 +85,6 @@ class Horde_Db_Adapter_MysqliSuite extends PHPUnit_Framework_TestSuite
 
     protected function setUp()
     {
-        $this->sharedFixture = $this;
+        Horde_Db_AllTests::$connFactory = $this;
     }
-
 }
index 4c60388..fe92d4b 100644 (file)
@@ -27,7 +27,7 @@ class Horde_Db_Adapter_MysqliTest extends PHPUnit_Framework_TestCase
     // @todo - add logger instance
     protected function setUp()
     {
-        list($this->_conn, $this->_cache) = $this->sharedFixture->getConnection();
+        list($this->_conn, $this->_cache) = Horde_Db_AllTests::$connFactory->getConnection();
 
         // clear out detritus from any previous test runs.
         $this->_dropTestTables();
@@ -1326,5 +1326,4 @@ class Horde_Db_Adapter_MysqliTest extends PHPUnit_Framework_TestCase
             if ($columns == $indexes) return $index;
         }
     }
-
 }
index 0ffda52..3596e80 100644 (file)
@@ -85,6 +85,6 @@ class Horde_Db_Adapter_Pdo_MysqlSuite extends PHPUnit_Framework_TestSuite
 
     protected function setUp()
     {
-        $this->sharedFixture = $this;
+        Horde_Db_AllTests::$connFactory = $this;
     }
 }
index 70ab819..0a47344 100644 (file)
@@ -27,7 +27,7 @@ class Horde_Db_Adapter_Pdo_MysqlTest extends PHPUnit_Framework_TestCase
     // @todo - add logger instance
     protected function setUp()
     {
-        list($this->_conn, $this->_cache) = $this->sharedFixture->getConnection();
+        list($this->_conn, $this->_cache) = Horde_Db_AllTests::$connFactory->getConnection();
 
         // clear out detritus from any previous test runs.
         $this->_dropTestTables();
@@ -1346,5 +1346,4 @@ class Horde_Db_Adapter_Pdo_MysqlTest extends PHPUnit_Framework_TestCase
             if ($columns == $indexes) return $index;
         }
     }
-
 }
index 1cc0406..0ed59bc 100644 (file)
@@ -88,7 +88,6 @@ class Horde_Db_Adapter_Pdo_PgsqlSuite extends PHPUnit_Framework_TestSuite
 
     protected function setUp()
     {
-        $this->sharedFixture = $this;
+        Horde_Db_AllTests::$connFactory = $this;
     }
-
 }
index cab6db3..dc7a352 100644 (file)
@@ -27,7 +27,7 @@ class Horde_Db_Adapter_Pdo_PgsqlTest extends PHPUnit_Framework_TestCase
     // @todo - add logger instance
     protected function setUp()
     {
-        list($this->_conn, $this->_cache) = $this->sharedFixture->getConnection();
+        list($this->_conn, $this->_cache) = Horde_Db_AllTests::$connFactory->getConnection();
 
         // clear out detritus from any previous test runs.
         $this->_dropTestTables();
index cf5b2bc..571f061 100644 (file)
@@ -71,7 +71,6 @@ class Horde_Db_Adapter_Pdo_SqliteSuite extends PHPUnit_Framework_TestSuite
 
     protected function setUp()
     {
-        $this->sharedFixture = $this;
+        Horde_Db_AllTests::$connFactory = $this;
     }
-
 }
index b0b3f27..24d6396 100644 (file)
@@ -27,7 +27,7 @@ class Horde_Db_Adapter_Pdo_SqliteTest extends PHPUnit_Framework_TestCase
     // @todo - add logger instance
     protected function setUp()
     {
-        list($this->_conn, $this->_cache) = $this->sharedFixture->getConnection();
+        list($this->_conn, $this->_cache) = Horde_Db_AllTests::$connFactory->getConnection();
 
         $table = $this->_conn->createTable('unit_tests');
           $table->column('integer_value',   'integer',  array('limit' => 11, 'default' => 0));
index aa32b0c..5f2cd78 100644 (file)
@@ -26,7 +26,7 @@ class Horde_Db_Adapter_Postgresql_ColumnDefinitionTest extends PHPUnit_Framework
 {
     protected function setUp()
     {
-        list($this->_conn,) = $this->sharedFixture->getConnection();
+        list($this->_conn,) = Horde_Db_AllTests::$connFactory->getConnection();
     }
 
     public function testConstruct()
index 1c93255..1ad3c83 100644 (file)
@@ -26,7 +26,7 @@ class Horde_Db_Adapter_Postgresql_TableDefinitionTest extends PHPUnit_Framework_
 {
     protected function setUp()
     {
-        list($this->_conn,) = $this->sharedFixture->getConnection();
+        list($this->_conn,) = Horde_Db_AllTests::$connFactory->getConnection();
     }
 
 
@@ -77,5 +77,4 @@ class Horde_Db_Adapter_Postgresql_TableDefinitionTest extends PHPUnit_Framework_
     public function testOffsetUnset()
     {
     }
-
 }
index 2f3c2ec..a39d3ea 100644 (file)
@@ -26,7 +26,7 @@ class Horde_Db_Adapter_Sqlite_ColumnDefinitionTest extends PHPUnit_Framework_Tes
 {
     protected function setUp()
     {
-        list($this->_conn,) = $this->sharedFixture->getConnection();
+        list($this->_conn,) = Horde_Db_AllTests::$connFactory->getConnection();
     }
 
     protected function tearDown()
@@ -120,5 +120,4 @@ class Horde_Db_Adapter_Sqlite_ColumnDefinitionTest extends PHPUnit_Framework_Tes
         $col->setDefault('test');
         $this->assertEquals('"col_name" varchar(255) DEFAULT \'test\'', $col->toSql());
     }
-
 }
index 10649de..93ecb7e 100644 (file)
@@ -26,7 +26,7 @@ class Horde_Db_Adapter_Sqlite_TableDefinitionTest extends PHPUnit_Framework_Test
 {
     protected function setUp()
     {
-        list($this->_conn,) = $this->sharedFixture->getConnection();
+        list($this->_conn,) = Horde_Db_AllTests::$connFactory->getConnection();
     }
 
     protected function tearDown()
@@ -83,5 +83,4 @@ class Horde_Db_Adapter_Sqlite_TableDefinitionTest extends PHPUnit_Framework_Test
     public function testOffsetUnset()
     {
     }
-
 }
index 87acf2d..6bb8bc9 100644 (file)
@@ -34,6 +34,8 @@ date_default_timezone_set('America/New_York');
  */
 class Horde_Db_AllTests extends Horde_Test_AllTests
 {
+    public static $connFactory;
+
     /**
      * Main entry point for running the suite.
      */
@@ -52,9 +54,7 @@ class Horde_Db_AllTests extends Horde_Test_AllTests
 
         // Set up autoload
         set_include_path(dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . 'lib' . PATH_SEPARATOR . get_include_path());
-        if (!spl_autoload_functions()) {
-            spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class); @include_once "$filename.php";'));
-        }
+        require_once 'Horde/Test/Autoload.php';
 
         // Build the suite
         $suite = new PHPUnit_Framework_TestSuite('Horde Framework - Horde_Db');