Fix output buffer error in phpunit>=4.2

Partial fix for #1262
Need improve exception handling. For now we are losing a stack trace and exception's class.
As you can see below: exception is re-thrown