PHPackages                             horat1us/yii2-phpunit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. horat1us/yii2-phpunit

ActiveLibrary[Testing &amp; Quality](/categories/testing)

horat1us/yii2-phpunit
=====================

Yii 2 PHPUnit compatibility layer and enhancements

0.0.6(5y ago)046MITPHPPHP &gt;=7.4

Since Jun 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Horat1us/yii2-phpunit)[ Packagist](https://packagist.org/packages/horat1us/yii2-phpunit)[ RSS](/packages/horat1us-yii2-phpunit/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (4)Versions (7)Used By (0)

Yii2 PhpUnit
============

[](#yii2-phpunit)

Yii 2 PHPUnit compatibility layer and enhancements This package includes:

- [TestLogger](./src/TestLogger.php) - will display all log messages to console
- [TestMailer](./src/TestMailer.php) - will collect all sent mails in memory
- [TestCase](./src/TestCase.php) - base TestCase, extends PHPUnit TestCase. It will create new `\yii\console\Application` instance before each test and apply Yii2 fixtures.
- [MigrateFixture](./src/MigrateFixture.php) - Yii2 fixture that will apply migration. Use case: your package contains migrations and you need to apply it before tests.

**Note: this package supposed to support old packages, that depends on it**

Usage
-----

[](#usage)

- Install package and *horat1us/yii2-phpunit* as dev dependencies

```
composer require --dev horat1us/yii2-phpunit
```

- Configure your PHPUnit and create bootstrap file with alias to config:

```
