title: Error when mocking interfaces in PHP using Mockery
body: <p>I have run into a problem when mocking Interfaces using Mockery in PHP (im using the laravel framework but I'm not sure this is relevant. </p>
  
  <p>I have defined an interface</p>
  
  <pre><code>&lt;?php namespace MyNamespace\SomeSubFolder;
  
  interface MyInterface {
  
      public function method1();
  
  }
  </code></pre>
  
  <p>And I have a class that typehints that interface on one of the methods...</p>
  
  <pre><code>&lt;?php namespace MyNamespace\SomeSubFolder;
  
  use MyNamespace\SomeSubFolder\MyInterface;
  
  class MyClass {
  
      public function execute(MyInterface $interface)
      {
           //does some stuff here
  
      }
  }
  </code></pre>
  
  <p>...and I am trying to test MyClass. I have created a test that looks something like this:</p>
  
  <pre><code>public function testExecute()
  {
  
      $mock = Mockery::mock('MyNamespace\SomeSubFolder\MyInterface');
  
      $mock-&gt;shouldReceive('method1')
           -&gt;andReturn('foo');
  
      $myClass = new MyClass();
  
      $myClass-&gt;execute($mock);
  
  }
  </code></pre>
  
  <p>When I run the test I receive the message </p>
  
  <p>'ErrorException: Argument 1 passed to MyClass::execute must be an instance of MyNamespace\SomeSubFolder\MyInterface, instance of Mockery_123465456 given....'</p>
  
  <p>I have no idea why.</p>
  
  <p>Within the test I have tried the following : </p>
  
  <pre><code>$this-&gt;assertTrue(interface_exists('MyNamespace\SomeSubFolder\MyInterface'));
  
  $this-&gt;assertTrue($mock instanceof MyInterface);
  </code></pre>
  
  <p>and both return true, so it appears as if I have created and instance that implements the interface, but when I call the method on the class it disagrees. Any ideas???</p>