title: How to reset a Mock Object with PHPUnit
body: <p>How can I reset the expects() for a PHPUnit Mock?</p>
  
  <p>I have a mock of the SoapClient that I would like to call multiple times within a test, resetting the expectations of each run.</p>
  
  <pre><code>$soapClientMock = $this-&gt;getMock('SoapClient', array('__soapCall'), array($this-&gt;config['wsdl']));
  $this-&gt;Soap-&gt;client = $soapClientMock;
  
  // call via query
  $this-&gt;Soap-&gt;client-&gt;expects($this-&gt;once())
      -&gt;method('__soapCall')
      -&gt;with('someString', null, null)
      -&gt;will($this-&gt;returnValue(true));
  
  $result = $this-&gt;Soap-&gt;query('someString'); 
  
  $this-&gt;assertFalse(!$result, 'Raw query returned false');
  
  $source = ConnectionManager::create('test_soap', $this-&gt;config);
  $model = ClassRegistry::init('ServiceModelTest');
  
  // No parameters
  $source-&gt;client = $soapClientMock;
  $source-&gt;client-&gt;expects($this-&gt;once())
      -&gt;method('__soapCall')
      -&gt;with('someString', null, null)
      -&gt;will($this-&gt;returnValue(true));
  
  $result = $model-&gt;someString();
  
  $this-&gt;assertFalse(!$result, 'someString returned false');
  </code></pre>