Test for the $$addToCache method