Commit 2c8af2fc authored by totten's avatar totten
Browse files

Merge branch 'testing' into 'master'

Update PhpStorm testing instructions with civibuild info

See merge request !967
parents fe6d862d 32816b29
......@@ -32,20 +32,19 @@ For browser helpers see: https://confluence.jetbrains.com/display/PhpStorm/Brows
## Running automated tests from within PhpStorm {:#testing}
*PhpStorm provides convenient tools for running and debugging unit tests in-app.*
!!! note
These instructions assume you already have a working instance of CiviCRM running locally with [buildkit](buildkit).
From the `Run > Edit Configurations` menu add a new PHPUnit configuration.
Check "Use alternative configuration file" and choose `phpunit.xml.dist` in your CiviCRM root directory.
Expand "Environment variables" and add the following two:
- `TEST_DB_DSN`: Use the DSN to connect to your test database. It is displayed on completion of civibuild. You should also be able to find it by running
`cv vars:show`.
- `CIVICRM_UF`: Use "UnitTests" unless you're running WebTests or End-to-end tests.
1. On the cli from a directory inside your build, run the command `civibuild phpunit-info`.
This outputs configuration settings you will need to paste into PhpStorm.
2. From the `Run > Edit Configurations` menu edit the default PHPUnit configuration for your project.
3. Check "Use alternative configuration file" and choose the one output by the `civibuild` command.
4. Set the custom working directory as specified by the `civibuild` output.
5. Expand "Environment variables" and add the variables shown in the `civibuild` output.
For step by step instructions (with screenshots!) see this [StackExchange answer](https://civicrm.stackexchange.com/questions/16489/how-do-i-run-php-unit-tests-w-xdebug-from-within-phpstorm-on-mac/16497#16497).
For more detailed instructions (with screenshots!) see this [StackExchange answer](https://civicrm.stackexchange.com/questions/16489/how-do-i-run-php-unit-tests-w-xdebug-from-within-phpstorm-on-mac/16497#16497).
### Adding external libraries
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment