arrow_back
Back

Yii2 testing: PHPUnit, Codeception, and test environments

Andrew Dorokhov Andrew Dorokhov schedule 1 min read

We can use PHPUnit as a testing framework. But you will face an issue when you install it with Composer and try to use it in a common way.

This is because Yii2 has its own autoloader (Yii.php) that differs from the Composer’s autoloader (vendor/autoload.php). So some classes won’t be accessible, and we will need to handle it.

Another option is to use Codeception - another great testing framework.

code

Need Help with Development?

Happy to help — reach out via the contacts or go straight to my Upwork profile.

work View Upwork Profile arrow_forward
Next Article

Yii2 application parameters: params.php and Yii::$app->params

arrow_forward