test different versions of doctrine

The build matrix system enables us to test with the versions we would
like to support.
conditionally mock methods

These methods / classes do not exist on all versions of doctrine.
This change makes the test suite green again for 2.2 and 2.3, while
keeping the exact same tests for 2.4.
Merge pull request #141 from greg0ire/build_matrix

test different versions of doctrine