I am tampering with an older application, which uses ADODB. However, I want to use the PDO extension for the database connection instead. To be able to create sufficient test cases for the the class before I make the transition, I want to make an extension of PDO which emulates ADODB.

The interface for ADOPDO is just about the following:

PHP Code:
class ADOPDO extends PDO
{
    public 
$debug;

    public function 
Execute($sql)
    {
        echo 
$sql;
        
$rs parent::query($sql);
        return new 
ADOPDO_Results($rs);
    }

    public function 
setFetchMode()
    {

    }

    public function 
Connect($host$user$password)
    {
        
parent::__construct($host$user$password);
    }

    public function 
PConnect()
    {

    }

    public function 
qstr($string$magicquotes false)
    {

    }

    function 
insert_ID() {

    }

}

class 
ADOPDO_Results
{
    public 
$EOF true;

    public function 
__construct($result)
    {
        
print_r($result);
    }

    public function 
MoveNext()
    {

    }
}

function 
ADONewConnection($type)
{
    return new 
ADOPDO($type);

However, then I stopped. Maybe someone already faced this problem and already created something useful, they wish to share.