PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » MDB2 » Bug #10189

Unit tests fail under PHP4

Details

Submitted2007-02-26 12:27 UTC
Fromandrew dot hill at openads dot org
Assignedquipo
StatusBogus
PackageMDB2
PHP Version4.3.11
OSCentos 4.3, Apache 1.3
Roadmaps(Not assigned)

Comments

[2007-02-26 12:27 UTC] andrew dot hill at openads dot org

Description:
------------
The test of __toString in MDB2_Internals_TestCase assumes PHP5, as the class/method names are in mixed case.

Test script:
---------------
Patch to convert expected string to lowercase when using PHP4:

--- MDB2/tests/MDB2_internals_testcase.php (revision 4658)
+++ MDB2/tests/MDB2_internals_testcase.php (working copy)
@@ -159,7 +159,11 @@

function test__toString()
{
- $this->assertEquals("MDB2_Driver_{$this->dsn['phptype']}: (phptype = {$this->dsn['phptype']}, dbsyntax = {$this->db->dbsyntax})",$this->db->__toString(), '__toString');
+ $expected = "MDB2_Driver_{$this->dsn['phptype']}: (phptype = {$this->dsn['phptype']}, dbsyntax = {$this->db->dbsyntax})";
+ if (version_compare(PHP_VERSION, "5.0.0", "<")) {
+ $expected = strtolower($expected);
+ }
+ $this->assertEquals($expected ,$this->db->__toString(), '__toString');
}

function test_setFetchMode()