Add $cache object to support migration permission changes

Migrations that add/set permissions cause the tests to fail. $cache object is needed for tests to pass.