refactored + temp fix for ZF2 https://github.com/zendframework/zf2/pull/4081
adjusted unit test environment