skip exiting in test env.

see https://github.com/yiisoft/yii2/commit/0cfd41a21a8d89cc577590a253893542e60d43ce#commitcomment-5238567
issue #2233