CRM_Case_XMLProcessor::allActivityTypes() doesn't do caching right
This isn't recent. The function looks like this:
public static function &allActivityTypes($indexName = TRUE, $all = FALSE) {
if (self::$activityTypes === NULL) {
self::$activityTypes = CRM_Case_PseudoConstant::caseActivityType($indexName, $all);
}
return self::$activityTypes;
}
So it works fine the first time in any given page run, but then if you call it again with different parameters it just returns the thing it cached last time regardless of the parameters. It isn't used very often and so I guess it doesn't come up in a typical page run, but it was driving me a bit nuts while trying to write a unit test and not getting what I was expecting.
PR coming, just debating whether it's worth trying to eliminate completely since it isn't used in that many places, i.e. deprecate it and replace everywhere it's used in core with CRM_Case_PseudoConstant::caseActivityType which does its own caching anyway.