public function checkCompleted()
{
$cardinality = $this->resetCardinality();
$calls = $this->spy->allCalls();
$matchingEvents = array();
$totalCount = count($calls);
$matchCount = 0;
foreach ($calls as $call) {
if ($endEvent = $call->endEvent()) {
$matchingEvents[] = $endEvent;
++$matchCount;
}
}
if ($cardinality->matches($matchCount, $totalCount)) {
return $this->assertionRecorder->createSuccess($matchingEvents);
}
}