PHPUnit error call to undefined method on mock
<p>I am getting Error: Call to undefined method Mock_SimpleInterface_8a93e777::mymethod() when I call the mymethod() on the Simple class mock.</p>

<pre><code>class PlaygroundTest extends \PHPUnit_Framework_TestCase 
{
    public function testMock()
    {
        $class     = $this-&gt;getMockBuilder('\Playground\Simple')-&gt;getMock();

        $class-&gt;mymethod();
    }
}
</code></pre>

<p>The Simple class implementation</p>

<pre><code>namespace Playground;

class Simple
{

    public function mymethod()
    {
        print "Hey!";
    }
}
</code></pre>

<p>According to PHPUnit docs (<a href="https://phpunit.de/manual/5.1/en/test-doubles.html" rel="nofollow">https://phpunit.de/manual/5.1/en/test-doubles.html</a>), it states that "By default, all methods of the original class are replaced with a dummy implementation that just returns null (without calling the original method)."</p>

<p>Shouldn't I be able to call mymethod() and get a null return value? I want to avoid to specify all class methods. PHPUnit should be clever enough to know which methods can be called on the mock or not.</p>

<p>Is this a bug? I'm using PHPUnit 5.1.4</p>