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.
we should only catch Yii2 exceptions i think, that was desigined for that purpose in functional testing