From a043be3ef9c727f846fbd52e44ea97b840e9684c Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Mon, 28 Oct 2013 15:48:57 +0100 Subject: [PATCH] added README for unit tests as requested in issue #1084 --- tests/README.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 tests/README.md diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 0000000..fa6b3a4 --- /dev/null +++ b/tests/README.md @@ -0,0 +1,41 @@ +Yii 2.0 Unit tests +================== + +DIRECTORY STRUCTURE +------------------- + + unit/ Unit tests to run with PHPUnit + data/ models, config and other test data + config.php this file contains configuration for database and caching backends + framework/ the framework unit tests + runtime/ the application runtime dir for the yii test app + web/ webapp for functional testing + + +HOW TO RUN THE TESTS +-------------------- + +Make sure you have PHPUnit installed. + +Run PHPUnit in the yii repo base directory. + +```php +phpunit +``` + +You can run tests for specific groups only: + +```php +phpunit --group=mysql,base,i18n +``` + +You can get a list of available groups via `phpunit --list-groups`. + +TEST CONFIGURATION +------------------ + +PHPUnit configuration is in `phpunit.xml.dist` in repository root folder. +You can create your own phpunit.xml to override dist config. + +Database and other backend system configuration can be found in `unit/data/config.php` +adjust them to your needs to allow testing databases and caching in your environment. \ No newline at end of file