registerInvocation(new MockInvocation($className, $methodName, $args, $count)); return $expectation; } public static function getTracker($name) { if (!isset(self::$trackers[$name])) { throw new LogicException('Unable to retrieve invocation tracker because the object does not exist in the registry'); } return self::$trackers[$name]; } private static function getInvocationCount($className, $methodName) { $count = 1; foreach (self::$trackers[$className]->getInvocations() as $invocation) { if ($invocation->getMethod() === $methodName) { $count++; } } return $count; } } ?>