1: <?php
 2: 
 3: namespace Mockery;
 4: 
 5: class ReceivedMethodCalls 
 6: {
 7:     private $methodCalls = array();
 8:     
 9:     public function push(MethodCall $methodCall)
10:     {
11:         $this->methodCalls[] = $methodCall;
12:     }
13: 
14:     public function verify(Expectation $expectation)
15:     {
16:         foreach ($this->methodCalls as $methodCall) {
17:             if ($methodCall->getMethod() !== $expectation->getName()) {
18:                 continue;
19:             }
20: 
21:             if (!$expectation->matchArgs($methodCall->getArgs())) {
22:                 continue;
23:             }
24: 
25:             $expectation->verifyCall($methodCall->getArgs());
26:         }
27: 
28:         $expectation->verify();
29:     }
30: }
31: