I started this post by describing a particular problem I'm having, but realized that what would be more valuable to me is a more general troubleshooting tool.
I frequently find myself asking "what is this function/method returning?", and I can't just create a quick CLI test script because it takes a context object as an argument.
I can't be the first person who's had this problem, so I wonder: does there exist a way to just say "create a context object for me as if I was logged in as user X and look at module Y"?
If there's no such thing, do people have any other advice for investigating those long chains where X calls Y, which calls Z, which calls... and somewhere along the way something unexpected is happening?
Thanks!