title: phpunit - reusing mock objects for multiple test suites
body: <p>I am curious as to how others approach this. Writing a test ain't so bad, but mocking kind of sucks a bit and cuts my flow. Is it ok for one to have a 'fixtures' directory and have say mock_db.php for example with just that particular mock declaration?</p>
  
  <p>Going one step further, would it be bad practice to have those mocks abstracted in a function?</p>
  
  <p>Ie:</p>
  
  <pre><code> // function to include a db mock
     include_once 'test/fixtures/dbmock.php';
  
     $mockMYSQL = $dbmock('mysql', 'db1');
     $mockMSSQL = $dbmock('mssql', 'db2');
  </code></pre>
  
  <p>JUst interested to know how other experienced testers handle this. I'm writing scripts to sync 2 databases so this example may become very relevant.</p>