title: Is there an equivalent of SimpleTest's "partial mocks" in PHPUnit?
body: <p>I'm trying to migrate a bunch of tests from SimpleTest to <a href="https://en.wikipedia.org/wiki/PHPUnit" rel="nofollow noreferrer">PHPUnit</a> and I was wondering if there is an equivalent for SimpleTest's <a href="http://www.simpletest.org/en/partial_mocks_documentation.html" rel="nofollow noreferrer">partial mocks</a>.</p>
  <p>I can't seem to find anything in the documentation which suggests that this feature is available, but it occurred to me that I could just use a subclass. Is this a good or bad idea?</p>
  <pre><code>class StuffDoer {
      protected function doesLongRunningThing() {
          sleep(10);
          return &quot;stuff&quot;;
      }
      public function doStuff() {
          return $this-&gt;doesLongRunningThing();
      }
  }
  
  class StuffDoerTest {
      protected function doesLongRunningThing() {
          return &quot;test stuff&quot;;
      }
  }
  
  class StuffDoerTestCase extends PHPUnit_Framework_TestCase {
      public function testStuffDoer() {
          $sd = new StuffDoerTest();
          $result = $sd-&gt;doStuff();
          $this-&gt;assertEquals($result, &quot;test stuff&quot;);
      }
  }
  </code></pre>