title: Laravel partial mocked model not invoked
body: <p>I'm using <strong>laravel (4.2)</strong> framework to develop a web application (PHP 5.4.25). I've create a repository-interface that was implemented with eloquent-repository, I use that repository inside a UserController:</p>
  
  <pre><code>#   app/controllers/UsersController.php
  
  use Gas\Storage\User\UserRepositoryInterface as User;
  
  class UsersController extends \BaseController {
      protected $user;
  
      public function __construct(User $user) {
          $this-&gt;user = $user;
  
      }
  
      public function store() {
          $input = Input::all();
          $validator = Validator::make(Input::all(), $this-&gt;user-&gt;getRoles());
  
          if ( $validator-&gt;passes() ) {
              $this-&gt;user-&gt;getUser()-&gt;username = Input::get('username');
              $this-&gt;user-&gt;getUser()-&gt;password = Hash::make(Input::get('password'));
              $this-&gt;user-&gt;getUser()-&gt;first_name = Input::get('first_name');
              $this-&gt;user-&gt;getUser()-&gt;last_name = Input::get('last_name');
              $this-&gt;user-&gt;getUser()-&gt;email = Input::get('email');
              $this-&gt;user-&gt;save();
  
  
              return false;
          } else {
              return true;
          }
      }
  }
  </code></pre>
  
  <p>My Repository implementation:</p>
  
  <pre><code>namespace Gas\Storage\User;
  
  #   app/lib/Gas/Storage/User/EloquentUserRepository.php
  
  use User;
  
  class EloquentUserRepository implements UserRepositoryInterface {
  
      public $_eloquentUser;
  
      public function __construct(User $user) {
          $this-&gt;_eloquentUser = $user;
      }
  
      public function all()
      {
          return User::all();
      }
  
      public function find($id)
      {
          return User::find($id);
      }
  
      public function create($input)
      {
          return User::create($input);
      }
  
      public function save()
      {
          $this-&gt;_eloquentUser-&gt;save();
      }
  
      public function getRoles()
      {
          return User::$rules;
      }
  
      public function getUser()
      {
          return $this-&gt;_eloquentUser;
      }
  }
  </code></pre>
  
  <p>I've also create a UsersControllerTest to testing the controller and all works fine, the user was added to the DB. After I mocked my <strong>UserRepositoryInterface</strong> because I don't need to test the DB insert, but I just want to test the controller</p>
  
  <pre><code>class UsersControllerTest extends TestCase {
      private $mock;
  
      public function setUp() {
          parent::setUp();
      }
  
      public function tearDown() {
          Mockery::close();
      }
  
      public function mock($class) {
          $mock = Mockery::mock($class);
  
          $this-&gt;app-&gt;instance($class, $mock);
  
          return $mock;
      }
  
      public function testStore() {
          $this-&gt;mock = $this-&gt;mock('Gas\Storage\User\UserRepositoryInterface[save]');
  
          $this-&gt;mock
              -&gt;shouldReceive('save')
              -&gt;once();
  
          $data['username'] = 'xxxxxx';
          $data['first_name'] = 'xxxx';
          $data['last_name'] = 'xxxx';
          $data['email'] = 'prova@gmail.com';
          $data['password'] = 'password';
          $data['password_confirmation'] = 'password';
  
          $response = $this-&gt;call('POST', 'users', $data);
  
          var_dump($response-&gt;getContent());
      }
  }
  </code></pre>
  
  <p>My ruote file:</p>
  
  <pre><code>Route::resource('users', 'UsersController');
  </code></pre>
  
  <p>When I run the test I get the following error:</p>
  
  <pre><code>Mockery\Exception\InvalidCountException : Method save() from Mockery_0_Gas_Storage_User_UserRepositoryInterface should be called
   exactly 1 times but called 0 times.
  </code></pre>
  
  <hr>
  
  <p>Why the mocked method <strong>save</strong> has not be called?</p>
  
  <p>What is wrong?</p>
  
  <hr>
  
  <p><strong>EDIT:</strong> without partial mock all works fine, now the question is: why with partial mock it doesn't work?</p>
  
  <hr>
  
  <p>Thanks </p>