Is it possible to mock out all methods on an object easily in PHPUnit?
<p>Is it possible to mock out any method calls on a stub and have it return the same response?</p>

<p>I'm looking to do something like this:</p>

<pre><code>$mock-&gt;expects($this-&gt;any())
    -&gt;method($this-&gt;any())
    -&gt;willReturn($mock);
</code></pre>

<p>I realize that this isn't a best practice, but I already have this section of code covered.  All the methods that actually get called should return the object itself too.</p>

<p>I've tried the above example and not adding the call to method. Neither worked and I can't find anything in the documentation.</p>