I'm fairly new to PHPUnit and I've been writing tests… that I probably should have written a while ago, but I'm currently running up against a problem. I have a polymorphic reference in one of my tables – it stores an instance id and the subplugin that instance belongs to. A lot of my code depends on those subplugins, but for kind of obvious reasons, I don't want to use the real subplugins in my test environment. This seems like a pretty clear case of "mock to the rescue" - except for this guy screwing everything up:
The mock plugin obviously doesn't really exist, and get_plugins_of_type isn't going to load up my plugininfo subclass unless Moodle thinks that plugin is real.
So my question is – how do you mock subplugins?