title: PHPUnit "Mocked method does not exist." when using $mock->expects($this->at(...))
body: <p>I've run into a strange issue with PHPUnit mock objects. I have a method that should be called twice, so I'm using the "at" matcher. This works for the first time the method is called, but for some reason, the second time it's called, I get "Mocked method does not exist.". I've used the "at" matcher before and have never run into this.</p>
  
  <p>My code looks something like:</p>
  
  <pre><code>class MyTest extends PHPUnit_Framework_TestCase
  {
      ...
  
      public function testThis()
      {
          $mock = $this-&gt;getMock('MyClass', array('exists', 'another_method', '...'));
          $mock-&gt;expects($this-&gt;at(0))
               -&gt;method('exists')
               -&gt;with($this-&gt;equalTo('foo'))
               -&gt;will($this-&gt;returnValue(true));
  
          $mock-&gt;expects($this-&gt;at(1))
               -&gt;method('exists')
               -&gt;with($this-&gt;equalTo('bar'))
               -&gt;will($this-&gt;returnValue(false));
      }
  
      ...
  }
  </code></pre>
  
  <p>When I run the test, I get:</p>
  
  <pre><code>Expectation failed for method name is equal to &lt;string:exists&gt; when invoked at sequence index 1.
  Mocked method does not exist.
  </code></pre>
  
  <p>If I remove the second matcher, I do not get the error.</p>
  
  <p>Has anyone run into this before?</p>
  
  <p>Thanks!</p>