I am curious how others approach this. Writing a test is not so bad, but the mocking look sucks and cuts my flow. Is it possible to have a fixtures directory and say mock_db.php, for example, only with this particular mock declaration?
Going further, would it be bad practice to have those bullying abstracted into functions?
Those:
// function to include a db mock include_once 'test/fixtures/dbmock.php'; $mockMYSQL = $dbmock('mysql', 'db1'); $mockMSSQL = $dbmock('mssql', 'db2');
JUst is interested in how other experienced testers deal with this. I write scripts to synchronize two databases, so this example can become very relevant.
source share