Update Yii2.php

We should check an interface otherwise we can't test project on mongodb or another databases
Merge pull request #1032 from dizews/patch-1

Update Yii2.php