title: Create a mock class with phpunit?
body: <p>Is there a way to create a mock class, as opposed to a mock object, with phpunit? I'm looking for a way to do dependency injection without having to explicitly pass every object a class might need to work with in the constructor (or wherever). Something that will return "true" for all of these cases:</p>
  
  <pre><code>public function testAAAA()
  {
    $foo = $this-&gt;getMock('foo', array('bar'));
    var_dump(class_exists('foo', false));
    var_dump(method_exists('foo', 'bar'));
    var_dump(method_exists($foo, 'bar'));
  }
  </code></pre>
  
  <p>This prints:</p>
  
  <pre><code>bool(true)
  bool(false)
  bool(true)
  </code></pre>
  
  <p>indicating that while it did successfully create a fake 'foo' class it did not bind a 'bar' method to it.</p>
  
  <p>I am using phpunit 3.7.5.</p>