Generator bug: Duplicate method generation

I've run into a bug in the generator, where it would generate the `on` method twice. I've attached a failing test case that demonstrates the issue.

I suggest you refactor `Generator::createClassMockCode` into smaller sub-methods so that you can check only the code inside the class, instead of all of the other boilerplate crap that is not really helpful in this case. It might already be possible to achieve by making the methods non-static and mocking out the methods that provide the boilerplate code (like `_getStandardMethods`).