BUG Allow PHPUnit installation with composer / Fix travis

See #3088 for 3.1 version.

I've updated .travis.yml and cleaned up the class inheritance a bit.