diff --git a/README.md b/README.md index f3ca5fc7f1540ff52173161b4085e1e9c2ddd7ba..153e3c0edd17e428f359d681cc5acbb4a1fa102f 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ The extension is licensed under [AGPL-3.0](LICENSE.txt). * [Add your own data source for a CiviCRM Entity](docs/add_your_own_datasource.md) * Add your own data source for a CSV File * How to store a data processor in code in your extension +* [Develop PHPUnit TestCase for the extension](docs/how_to_create_test.md) ## Installation diff --git a/docs/how_to_create_test.md b/docs/how_to_create_test.md new file mode 100644 index 0000000000000000000000000000000000000000..ecb3a95df52e2db8054829b4ba48b6339ddc3181 --- /dev/null +++ b/docs/how_to_create_test.md @@ -0,0 +1,8 @@ +# How to create a PHPUnit Test + +- Create file with appropriate name ending with test. For Example `CreateDataProcessorTest.php` +- Follow the simplest test case file `CreateDataProcessorTest.php` for creating a test case. +- Create a function whose name starting with test. For Example `testCreateDataProcessor`. All the function starting with **test** will be evaluated, so name your utility functions properly. +- If you want to reset the Test Database and install from beginning pass `True` in `apply()` function in `setupHeadless() function`. +- Don't remove `setUp()` and `tearDown()` function from the UnitTest file. +