This package is abandoned and no longer maintained. No replacement package was suggested.
Yii 2 PHPUnit compatibility layer and enhancements
This package has no released version yet, and little information is available.
Yii 2 PHPUnit compatibility layer and enhancements This package includes:
- TestLogger - will display all log messages to console
- TestMailer - will collect all sent mails in memory
- TestCase - base TestCase, extends PHPUnit TestCase.
It will create new
\yii\console\Applicationinstance before each test and apply Yii2 fixtures.
- MigrateFixture - Yii2 fixture that will apply migration. Use case: your package contains migrations and you need to apply it before tests.
- Install package and phpunit/phpunit as dev dependencies
composer require --dev yiisoft/yii2-phpunit phpunit/phpunit
- Configure your PHPUnit and create bootstrap file with alias to config:
<?php // bootstrap.php Yii::setAlias('@configFile', 'path-to-config.php');
- Create your test cases that extend yii\phpunit\TestCase
See horat1us/yii2-advanced-package for details.