From 4673d266704902f243d77a74c5ac1cd97b8c496b Mon Sep 17 00:00:00 2001 From: Kuba Turek Date: Fri, 23 Jan 2015 19:40:23 +0100 Subject: [PATCH] [#183] Add some instructions about code coverage --- CONTRIBUTING.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 767b314..710c26b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -61,7 +61,15 @@ The rules above have been set a long time after the project has started. If you 4. PHP Dead Code Detector ## Testing and quality -We use PHPUnit to test our classes. Now not the whole project is covered with tests but we've been working on it for some time. If you want your code to be merged into Magallanes, we want you to push it with proper tests. We would love to reach and keep at leats 90% of code coverage. In short time we want to configure quality tools to make sure your code is tested properly with minimum coverage. Anyway, try to keep 100% of Code Coverage in your pull requests. +We use PHPUnit to test our classes. Now not the whole project is covered with tests but we've been working on it for some time. If you want your code to be merged into Magallanes, we want you to push it with proper tests. We would love to reach and keep at least 90% of line code coverage. In short time we want to configure quality tools to make sure your code is tested properly with minimum coverage. Anyway, try to keep 100% of Code Coverage in your pull requests. To run your tests with code coverage report, you can either run it with: +``` +/bin/phpunit --coverage-text +``` +or with more friendly and detailed user graphical representation, into HTML: +``` +/bin/phpunit --coverate-html report +``` +where `report` is the directory where html report files shall be stored. Tests structure follow the same structure as production code with `Test` suffix in class and file name. All tests should go to `tests` directory in project root. So if you've created a class `Mage\Tasks\BuilIn\NewTask` the testing class should be called `MageTest\Tasks\BuiltIn\NewTaskTest`. ## Configuration