Hi Christian
On 08.12.2012 22:16, Christian Aistleitner wrote:
However, we actually do not need those databases and tables for testing. For testing, it would be sufficient to have mock database objects [1] that pretend that there are underlying databases, tables, etc.
Hm... so, if that mock DB object is used on the code, which tried to execute an SQL query against it, it will work? Sounds like that should at least be an in-memory sqlite instance... The trouble is, we do *not* have an abstraction layer on top of SQL. We just have one for different SQL implementations. To abstract from SQL, we'd need a full DAO layer. We don't have that.
Anyway: even if that works, one reason not to do it would be the ability to test against different database engines. The PostGres people are quite keen on that. But I suppose that could remain as an optional feature.
Also: once I have a mock object, how do I inject it into the load balancer/LBFactory, so wfGetLB( 'foo' )->getConnection( DB_SLAVE, null, 'foo' ) will return the correct mock object (one one for wiki 'foo')? Global state is evil...
If you could help me to answer that last question, that would already help me a lot...
thanks daniel