public function atTestEnd($test_method, &$test)
{
foreach ($this->expected_counts as $method => $expectation) {
$test->assert($expectation, $this->getCallCount($method));
}
foreach ($this->max_counts as $method => $expectation) {
if ($expectation->test($this->getCallCount($method))) {
$test->assert($expectation, $this->getCallCount($method));
}
}
}