How to test across multiple mysql schemas with PHPUnit?

I would like to test a process that queries across multiple schemas using PHPUnit's PHPUnit_Extensions_Database_TestCase class. I've dug through the documentation, SO and the source code, but it seems like I have to set up my database using something like:

protected function getConnection()
{
    $this->pdo = new PDO('mysql:host=localhost;dbname=unit_test_schema', 'xxxx', 'yyyy');
    return $this->createDefaultDBConnection($this->pdo, 'unit_test_schema');    
}

protected function getDataSet()
{
    return $this->createXMLDataSet(DB_SETUP_DIR.'/schema.xml');
}

Is there a way to somehow use more than one schema so I can test a query like:

SELECT *
FROM   schema1.tableA
JOIN   schema2.tableB
USING  (id)

EDIT: To be clear, the issue I'm trying to resolve is that I can only figure out how to pass schema setup files to one database. I'd like to find a way to say "create tables1.xml in schema1 and tables2.xml in schema2." The tables referenced in the different xml files would be filled-and-killed for each test.

13
задан Parris Varney 13 May 2011 в 14:08
поделиться