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).
Extract Generator::createClassMock into method that does not eval
Make generated mock code more readable
Add failing test for generator bug (repeated method generation)
Duplication verified using the PR rebased to master.
This PR has been merged in local branch generator-fail for investigation
Add test for #98