Bug Report #4248

Unable to unit-test with in-memory PDO databases

Added by Marcus Cobden over 3 years ago. Updated about 3 years ago.

Status:NewStart date:09/05/2011
Priority:NormalDue date:
Assignee:Chris Bandy% Done:


Target version:Kohana v3.x - Unscheduled
Resolution: Points:1


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.


#1 Updated by Chris Bandy over 3 years ago

What would the general case for this look like? Should Database be able to wrap already open connections?

#3 Updated by Chris Bandy about 3 years ago

  • Project changed from Kohana v3.x to UnitTest
  • Category deleted (Modules:Database)
  • Assignee set to Chris Bandy

I think the right way to resolve this is to implement a PHPUnit_Extensions_Database_DB_IDatabaseConnection backed by Kohana_Database.

#4 Updated by Chris Bandy about 3 years ago

  • Target version set to v3.3.0

#5 Updated by Jeremy Bush about 3 years ago

  • Target version changed from v3.3.0 to Unscheduled

Also available in: Atom PDF