From: Chuck Hagenbuch Date: Sun, 3 Oct 2010 21:19:06 +0000 (-0400) Subject: Horde_Db test suite now runs with PHPUnit 3.5 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=8cc74998cae9511fbc289fe0e1bd37c23936ed14;p=horde.git Horde_Db test suite now runs with PHPUnit 3.5 --- diff --git a/framework/Db/test/Horde/Db/Adapter/MissingTest.php b/framework/Db/test/Horde/Db/Adapter/MissingTest.php index a148815fb..9066ab0f7 100644 --- a/framework/Db/test/Horde/Db/Adapter/MissingTest.php +++ b/framework/Db/test/Horde/Db/Adapter/MissingTest.php @@ -28,5 +28,4 @@ class Horde_Db_Adapter_MissingTest extends PHPUnit_Framework_TestCase { $this->markTestSkipped('The ' . $this->adapter . ' adapter is not available'); } - } diff --git a/framework/Db/test/Horde/Db/Adapter/Mysql/ColumnDefinitionTest.php b/framework/Db/test/Horde/Db/Adapter/Mysql/ColumnDefinitionTest.php index 7029c8e70..fffa4b08f 100644 --- a/framework/Db/test/Horde/Db/Adapter/Mysql/ColumnDefinitionTest.php +++ b/framework/Db/test/Horde/Db/Adapter/Mysql/ColumnDefinitionTest.php @@ -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() diff --git a/framework/Db/test/Horde/Db/Adapter/Mysql/ColumnTest.php b/framework/Db/test/Horde/Db/Adapter/Mysql/ColumnTest.php index 8f85d450f..f876525fd 100644 --- a/framework/Db/test/Horde/Db/Adapter/Mysql/ColumnTest.php +++ b/framework/Db/test/Horde/Db/Adapter/Mysql/ColumnTest.php @@ -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()); } - } diff --git a/framework/Db/test/Horde/Db/Adapter/Mysql/TableDefinitionTest.php b/framework/Db/test/Horde/Db/Adapter/Mysql/TableDefinitionTest.php index b073e4b6a..269a2e7d3 100644 --- a/framework/Db/test/Horde/Db/Adapter/Mysql/TableDefinitionTest.php +++ b/framework/Db/test/Horde/Db/Adapter/Mysql/TableDefinitionTest.php @@ -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() { } - } diff --git a/framework/Db/test/Horde/Db/Adapter/MysqlSuite.php b/framework/Db/test/Horde/Db/Adapter/MysqlSuite.php index 7844800da..3363e03c2 100644 --- a/framework/Db/test/Horde/Db/Adapter/MysqlSuite.php +++ b/framework/Db/test/Horde/Db/Adapter/MysqlSuite.php @@ -87,7 +87,6 @@ class Horde_Db_Adapter_MysqlSuite extends PHPUnit_Framework_TestSuite protected function setUp() { - $this->sharedFixture = $this; + Horde_Db_AllTests::$connFactory = $this; } - } diff --git a/framework/Db/test/Horde/Db/Adapter/MysqlTest.php b/framework/Db/test/Horde/Db/Adapter/MysqlTest.php index e33713294..00cb5f42e 100644 --- a/framework/Db/test/Horde/Db/Adapter/MysqlTest.php +++ b/framework/Db/test/Horde/Db/Adapter/MysqlTest.php @@ -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; } } - } diff --git a/framework/Db/test/Horde/Db/Adapter/MysqliSuite.php b/framework/Db/test/Horde/Db/Adapter/MysqliSuite.php index 2337f4af1..7b5371d3f 100644 --- a/framework/Db/test/Horde/Db/Adapter/MysqliSuite.php +++ b/framework/Db/test/Horde/Db/Adapter/MysqliSuite.php @@ -85,7 +85,6 @@ class Horde_Db_Adapter_MysqliSuite extends PHPUnit_Framework_TestSuite protected function setUp() { - $this->sharedFixture = $this; + Horde_Db_AllTests::$connFactory = $this; } - } diff --git a/framework/Db/test/Horde/Db/Adapter/MysqliTest.php b/framework/Db/test/Horde/Db/Adapter/MysqliTest.php index 4c603883d..fe92d4b1a 100644 --- a/framework/Db/test/Horde/Db/Adapter/MysqliTest.php +++ b/framework/Db/test/Horde/Db/Adapter/MysqliTest.php @@ -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; } } - } diff --git a/framework/Db/test/Horde/Db/Adapter/Pdo/MysqlSuite.php b/framework/Db/test/Horde/Db/Adapter/Pdo/MysqlSuite.php index 0ffda52ec..3596e8087 100644 --- a/framework/Db/test/Horde/Db/Adapter/Pdo/MysqlSuite.php +++ b/framework/Db/test/Horde/Db/Adapter/Pdo/MysqlSuite.php @@ -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; } } diff --git a/framework/Db/test/Horde/Db/Adapter/Pdo/MysqlTest.php b/framework/Db/test/Horde/Db/Adapter/Pdo/MysqlTest.php index 70ab8195e..0a4734424 100644 --- a/framework/Db/test/Horde/Db/Adapter/Pdo/MysqlTest.php +++ b/framework/Db/test/Horde/Db/Adapter/Pdo/MysqlTest.php @@ -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; } } - } diff --git a/framework/Db/test/Horde/Db/Adapter/Pdo/PgsqlSuite.php b/framework/Db/test/Horde/Db/Adapter/Pdo/PgsqlSuite.php index 1cc0406f9..0ed59bcd5 100644 --- a/framework/Db/test/Horde/Db/Adapter/Pdo/PgsqlSuite.php +++ b/framework/Db/test/Horde/Db/Adapter/Pdo/PgsqlSuite.php @@ -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; } - } diff --git a/framework/Db/test/Horde/Db/Adapter/Pdo/PgsqlTest.php b/framework/Db/test/Horde/Db/Adapter/Pdo/PgsqlTest.php index cab6db38e..dc7a3521e 100644 --- a/framework/Db/test/Horde/Db/Adapter/Pdo/PgsqlTest.php +++ b/framework/Db/test/Horde/Db/Adapter/Pdo/PgsqlTest.php @@ -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(); diff --git a/framework/Db/test/Horde/Db/Adapter/Pdo/SqliteSuite.php b/framework/Db/test/Horde/Db/Adapter/Pdo/SqliteSuite.php index cf5b2bc95..571f061fe 100644 --- a/framework/Db/test/Horde/Db/Adapter/Pdo/SqliteSuite.php +++ b/framework/Db/test/Horde/Db/Adapter/Pdo/SqliteSuite.php @@ -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; } - } diff --git a/framework/Db/test/Horde/Db/Adapter/Pdo/SqliteTest.php b/framework/Db/test/Horde/Db/Adapter/Pdo/SqliteTest.php index b0b3f2790..24d639636 100644 --- a/framework/Db/test/Horde/Db/Adapter/Pdo/SqliteTest.php +++ b/framework/Db/test/Horde/Db/Adapter/Pdo/SqliteTest.php @@ -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)); diff --git a/framework/Db/test/Horde/Db/Adapter/Postgresql/ColumnDefinitionTest.php b/framework/Db/test/Horde/Db/Adapter/Postgresql/ColumnDefinitionTest.php index aa32b0cb1..5f2cd7882 100644 --- a/framework/Db/test/Horde/Db/Adapter/Postgresql/ColumnDefinitionTest.php +++ b/framework/Db/test/Horde/Db/Adapter/Postgresql/ColumnDefinitionTest.php @@ -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() diff --git a/framework/Db/test/Horde/Db/Adapter/Postgresql/TableDefinitionTest.php b/framework/Db/test/Horde/Db/Adapter/Postgresql/TableDefinitionTest.php index 1c932559b..1ad3c8386 100644 --- a/framework/Db/test/Horde/Db/Adapter/Postgresql/TableDefinitionTest.php +++ b/framework/Db/test/Horde/Db/Adapter/Postgresql/TableDefinitionTest.php @@ -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() { } - } diff --git a/framework/Db/test/Horde/Db/Adapter/Sqlite/ColumnDefinitionTest.php b/framework/Db/test/Horde/Db/Adapter/Sqlite/ColumnDefinitionTest.php index 2f3c2eced..a39d3ea0a 100644 --- a/framework/Db/test/Horde/Db/Adapter/Sqlite/ColumnDefinitionTest.php +++ b/framework/Db/test/Horde/Db/Adapter/Sqlite/ColumnDefinitionTest.php @@ -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()); } - } diff --git a/framework/Db/test/Horde/Db/Adapter/Sqlite/TableDefinitionTest.php b/framework/Db/test/Horde/Db/Adapter/Sqlite/TableDefinitionTest.php index 10649dea8..93ecb7e6b 100644 --- a/framework/Db/test/Horde/Db/Adapter/Sqlite/TableDefinitionTest.php +++ b/framework/Db/test/Horde/Db/Adapter/Sqlite/TableDefinitionTest.php @@ -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() { } - } diff --git a/framework/Db/test/Horde/Db/AllTests.php b/framework/Db/test/Horde/Db/AllTests.php index 87acf2de6..6bb8bc9ce 100644 --- a/framework/Db/test/Horde/Db/AllTests.php +++ b/framework/Db/test/Horde/Db/AllTests.php @@ -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');