title: Mockery no matching handler for closure
body: <p>I can't figure out why I'm getting this error during this test.  My test appears to be matching the rest of the code exactly.  What am I overlooking?</p>
  
  <p>In my test I have:</p>
  
  <pre><code>    $passwordBroker = m::mock('Illuminate\Auth\Reminders\PasswordBroker');
      $passwordBroker-&gt;shouldReceive('reset')
          -&gt;once()
          -&gt;with(
              $this-&gt;resetAttributes,
              m::on(function (\Closure $closure) {
                  $this-&gt;entity
                      -&gt;shouldReceive('setAttribute')
                      -&gt;once()
                      -&gt;with('password', $this-&gt;resetAttributes['password']);
                  $this-&gt;entity
                      -&gt;shouldReceive('getAttributes')
                      -&gt;once()
                      -&gt;andReturn($this-&gt;resetAttributes);
  
                  $closure($this-&gt;entity, $this-&gt;resetAttributes['password']);
              })
          );
  </code></pre>
  
  <p>The error: </p>
  
  <pre><code>Mockery\Exception\NoMatchingExpectationException: No matching handler found for Mockery_4_Illuminate_Auth_Reminders_PasswordBroker::reset(array('email'=&gt;'test@email.com','password'=&gt;'myTestPassword','password_confirmation'=&gt;'myTestPassword',), Closure). Either the method was unexpected or its arguments matched no expected argument list for this method
  
  Objects: (array (
    'Closure' =&gt; 
    array (
      'class' =&gt; 'Closure',
      'properties' =&gt; 
      array (
      ),
      'getters' =&gt; 
      array (
      ),
    ),
  ))
  </code></pre>
  
  <p>Part of my lack of understanding may have to do with the fact that I'm not sure what the <code>Objects: array(....)</code> is that appears at the bottom of the error.</p>