Bug Report #4248
Unable to unit-test with in-memory PDO databases
|Assignee:||Chris Bandy||% Done:||
|Target version:||Kohana v3.x - Unscheduled|
The database fixtures part of phpunit requires a PDO object in order to do its job.
For 'real' databases this is fine because you can make a second connection, however with in-memory databases doing this creates a second database.
In order to unit test on an in-memory database access to the inner PDO object is needed.
Updated by Chris Bandy over 2 years ago
What would the general case for this look like? Should
Database be able to wrap already open connections?
Updated by Marcus Cobden about 2 years ago
I've not really considered the wider implications of how the API would look.
For reference, here's how we worked around it:
Updated by Chris Bandy about 2 years ago
- Project changed from Kohana v3.x to UnitTest
- Category deleted (
- Assignee set to Chris Bandy
I think the right way to resolve this is to implement a
PHPUnit_Extensions_Database_DB_IDatabaseConnection backed by