Home » Database » MDB2 » Bug #10189
Unit tests fail under PHP4
Details
| Submitted | 2007-02-26 12:27 UTC |
|---|---|
| From | andrew dot hill at openads dot org |
| Assigned | quipo |
| Status | Bogus |
| Package | MDB2 |
| PHP Version | 4.3.11 |
| OS | Centos 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()