diff --git a/core/phpunit.xml.dist b/core/phpunit.xml.dist index 951bd55d44b981e95add270c3d3b4edc8312ccb6..9658f2ce04e5cfbfdee22c7e4c22938209087889 100644 --- a/core/phpunit.xml.dist +++ b/core/phpunit.xml.dist @@ -1,19 +1,23 @@ - + diff --git a/core/tests/README.md b/core/tests/README.md index dfd1154a753c43458f578a4d8da45b2c22e7c954..b3ed5a07e36dc9661aae06929cc1d980be452f25 100644 --- a/core/tests/README.md +++ b/core/tests/README.md @@ -13,3 +13,36 @@ ./vendor/bin/phpunit -c core --testsuite functional ./vendor/bin/phpunit -c core --testsuite functional-javascript ``` + +Note: functional tests have to be invoked with a user in the same group as the +web server user. You can either configure Apache (or nginx) to run as your own +system user or run tests as a privileged user instead. + +To develop locally, a straigtforward - but also less secure - approach is to run +tests as your own system user. To achieve that, change the default Apache user +to run as your system user. Typically, you'd need to modify +`/etc/apache2/envvars` on Linux or `/etc/apache2/httpd.conf` on Mac. + +Example for Linux: + +``` +export APACHE_RUN_USER= +export APACHE_RUN_GROUP= +``` + +Example for Mac: + +``` +User +Group +``` + +If the default user is e.g. `www-data`, the above functional tests will have to +be invoked with sudo instead: + +``` +export SIMPLETEST_DB='mysql://root@localhost/dev_d8' +export SIMPLETEST_BASE_URL='http://d8.dev' +sudo -u www-data ./vendor/bin/phpunit -c core --testsuite functional +sudo -u www-data ./vendor/bin/phpunit -c core --testsuite functional-javascript +```