title: Mock method from the same class that tested method is using
body: <p>I have following code:</p>
  
  <pre><code>class Foo() {
      public function someMethod() {
          ...
          if ($this-&gt;otherMethod($lorem, $ipsum)) {
              ...
          }
          ...
      }
  }
  </code></pre>
  
  <p>and I'm trying to test the someMethod(), I don't want to test otherMethod() since it's quite complex and I have dedicated tests - here I would only like to mock it and return specific values.
  So I tried to:</p>
  
  <pre><code>$fooMock = Mockery::mock(Foo::class)
      -&gt;makePartial();
  $fooMock-&gt;shouldReceive('otherMethod')
      -&gt;withAnyArgs()
      -&gt;andReturn($otherMethodReturnValue);
  </code></pre>
  
  <p>and in test I'm calling</p>
  
  <pre><code>$fooMock-&gt;someMethod()
  </code></pre>
  
  <p>But it's using the original (not mocked) method otherMethod() and prints errors.</p>
  
  <pre><code> Argument 1 passed to Mockery_3_Foo::otherMethod() must be an instance of SomeClass, boolean given
  </code></pre>
  
  <p>Could you help me please?</p>