public function checkCalledWith()
{
$cardinality = $this->resetCardinality();
$matchers = $this->matcherFactory->adaptAll(func_get_args());
$calls = $this->spy->allCalls();
$matchingEvents = array();
$totalCount = count($calls);
$matchCount = 0;
foreach ($calls as $call) {
if ($this->matcherVerifier->matches($matchers, $call->arguments()->all())) {
$matchingEvents[] = $call;
++$matchCount;
}
}
if ($cardinality->matches($matchCount, $totalCount)) {
return $this->assertionRecorder->createSuccess($matchingEvents);
}
}