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
FYI, Not sure if its related, but I encountered the same thing, but not with the $this->at() method, for me it was the $this->never() method.
This raised the error
$mock->expects($this->never())
->method('exists')
->with('arg');
This fixed the error
$mock->expects($this->never())
->method('exists');
It did the same thing when using the $this->exactly(0) method.
Hope this help someone.