From b511667072fd7202d4e6f2eac08ab5dc67d3de01 Mon Sep 17 00:00:00 2001 From: Don Hirst <dvhirst@aol.com> Date: Sat, 9 Sep 2017 15:30:01 -0700 Subject: [PATCH] Update phpstorm.md Reading for content; editing for consistency. --- docs/tools/phpstorm.md | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/docs/tools/phpstorm.md b/docs/tools/phpstorm.md index 6c052f9b..dcfc52a8 100644 --- a/docs/tools/phpstorm.md +++ b/docs/tools/phpstorm.md @@ -37,36 +37,26 @@ For browser helpers see: https://confluence.jetbrains.com/display/PhpStorm/Brows 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. +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 +- `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. +- `CIVICRM_UF`: Use "UnitTests" unless you're running WebTests or End-to-end tests. 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). ### Adding external libraries -It can be frustrating when writing tests the PHPStorm complains about missing -classes or undefined methods. This happens because PHPUnit is not included in -the CiviCRM codebase. +It can be frustrating when writing tests the PHPStorm complains about missing classes or undefined methods. This happens because PHPUnit is not included in the CiviCRM codebase. -To remedy this you can add an external content root. You'll need to clone the -[phpunit] library locally. Then from that directory check out the latest supported -version of phpunit (4.x right now). +To remedy this you can add an external content root. You'll need to clone the [phpunit] library locally. Then from that directory check out the latest supported version of phpunit (4.x right now). -After that you just add the directory to your project include paths by -[following the instructions on the Jetbrains site][phpstorm-include-paths]. +After that you just add the directory to your project include paths by [following the instructions on the Jetbrains site][phpstorm-include-paths]. [phpstorm-include-paths]: https://www.jetbrains.com/help/phpstorm/configuring-include-paths.html [phpunit]: https://github.com/sebastianbergmann/phpunit Alternatively: always use buildkit to generate you CiviCRM development environment; it ships with many tools - including phpunit4 - - -- GitLab