title: disableOriginalConstructor() and will() conflict
body: <p>I have a model that uses DB adapter, that I want to test. The DB adapter's constructor deals with all the DB connection, so I would like to avoid it during testing, otherwise it returns errors with regards to db pass / db username etc not being set.</p>
  
  <p>The code I'm currently running is below, as you see I'm using <code>disableOriginalConstructor()</code> to prevent calling the constructor.</p>
  
  <p>The problem is that I'm getting this error, when I try to use <code>$mysql_stub</code> in <code>will()</code>:</p>
  
  <blockquote>
    <p>Argument 1 passed to
    PHPUnit_Framework_MockObject_Builder_InvocationMocker::will() must
    implement interface PHPUnit_Framework_MockObject_Stub, instance of
    Mock_Pages_MySQL_Page_46612429 given, called in
    /Applications/MAMP/htdocs/lib/Pages/trunk/Tests/Unit/PageTest.php on
    line 185 and defined</p>
  </blockquote>
  
  <p>Could someone advise, what would the correct syntax be?</p>
  
  <pre><code>class Page {
  
    public function getByUrl($url)
    {
        $db_page = $this-&gt;getDAOInterface();
        $db_page-&gt;getByUrl($url);
        $this-&gt;assign($db_page);
        return $this;
    }
  
  }
  
  class PageTest extends PHPUnit_Framework_TestCase
  {
    public function testGetByUrl()
    {
        $test_url   = "foo-bar";
        $page_stub  = $this-&gt;getMock(
            'Pages_Model_Page', 
            array('getDAOInterface', 'assign')
        );
  
        $mysql_stub = $this-&gt;getMockBuilder('Pages_MySQL_Page')
                           -&gt;setMethods(array('getByUrl'))
                           -&gt;disableOriginalConstructor()
                           -&gt;getMock();
  
        $mysql_stub-&gt;expects($this-&gt;once())
                  -&gt;method('getByUrl')
                  -&gt;with($this-&gt;equalTo($test_url));
  
        $page_stub-&gt;expects($this-&gt;once())
                  -&gt;method('getDAOInterface')
                  -&gt;with()
                  -&gt;will($mysql_stub);
  
        $page_stub-&gt;expects($this-&gt;once())
                  -&gt;method('assign')
                  -&gt;with($mysql_stub);
  
        $page_stub-&gt;geByUrl($test_url);
    }
  }
  </code></pre>