kartavik/yii2-phpunit

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.


README

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\Application instance 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.

Usage

  • 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');

Example

See horat1us/yii2-advanced-package for details.