title: PHP Unit Testing: Mocked methods are not getting triggered while executing the test case
body: <p>I am developing test cases for Unit Testing with Zend framework. Installed PHPUnit using composer. I am working on Windows platform.  </p>
  
  <p>I am trying to mock a method. While executing the test case, mocked method is not invoking. Instead I tried with system defined method, it is working fine as expected.  </p>
  
  <p>Please see below code:  </p>
  
  <pre><code>/* Class CommonDataHandlerTest */
  class CommonDataHandlerTest extends PHPUnit_Framework_TestCase{
        public function mockTestCall(){
               return 'foo';
        }
  }
  
  
  class Apps_Sample_DataHandlerTest extends CommonDataHandlerTest{
       public function setUp() {
        ....
       }
  
       public function tearDown() {
        ....
       }
  
       /*But here the method mockTestCall is not triggering while executing */
       public function testReturnCallbackStub() {
  
             $observer = $this-&gt;getMockBuilder('Apps_Sample_DataHandler')
              -&gt;disableOriginalConstructor()
              -&gt;disableOriginalClone()
              -&gt;disableArgumentCloning()
              -&gt;getMock();
  
  
            $that = $this;
            $observer-&gt;method('getSampleData')
               -&gt;will($this-&gt;returnCallback(
                  function() use($that) {
                    $that-&gt;mockTestCall();
                  }
            ));
  
  
            $this-&gt;assertEquals('foo', $observer-&gt;getSampleData());
      }
  
      /*This is method is working as expected*/
      public function testReturnCallbackStubSystem() {
  
            $observer = $this-&gt;getMockBuilder('Apps_Sample_DataHandler')
              -&gt;disableOriginalConstructor()
              -&gt;disableOriginalClone()
              -&gt;disableArgumentCloning()
              -&gt;getMock();
  
  
           $observer-&gt;method('getSampleData')
               -&gt;will($this-&gt;returnCallback('str_rot13'));
  
  
           $this-&gt;assertEquals('foo', $observer-&gt;getSampleData('ssb'));
      }
  
  }
  </code></pre>
  
  <p>While executing the above code, the test case method 'testReturnCallbackStubSystem' is working as expected.<br>
  But the test case method 'testReturnCallbackStub' is not working. Here the mocked method 'mockTestCall' is not getting triggered.</p>
  
  <p>May I know the reason please?
  Somebody please help me on this. If you want if any more details, please let me know.  </p>
  
  <p>Thanks in advance...</p>