Test actual class method using mock object in PHPUnit
<p>What I want to do: create a Mock object that does not execute the <code>__constructor()</code>, but DOES have all methods as they were coded (not mocked to return null).</p>

<p><a href="https://phpunit.de/manual/current/en/test-doubles.html" rel="nofollow">The docs</a> say: </p>

<blockquote>
  <p>"By default, all methods of the original class are replaced with a
  dummy implementation that just returns null (without calling the
  original method). Using the <code>will($this-&gt;returnValue())</code> method, for
  instance, you can configure these dummy implementations to return a
  value when called."</p>
</blockquote>

<p>That's not what I want. I don't want to force a method to return a known value. I want to test the method itself, and therefore need a functioning instantiation of the class, but with a disabled constructor.</p>

<p>How do I do that?</p>