drupal/core/tests
xjm e4ae1c1af2 Issue #2691971 by imrancluster, lluvigne, andrewmacpherson, royal121, John Cook, emallove, tstoeckler, alexpott, Cottser, ok_lyndsey, webchick: "Update Notifications" #title repeated for drupal 8 installation in configure site page 2017-02-12 14:19:31 -06:00
..
Drupal Issue #2691971 by imrancluster, lluvigne, andrewmacpherson, royal121, John Cook, emallove, tstoeckler, alexpott, Cottser, ok_lyndsey, webchick: "Update Notifications" #title repeated for drupal 8 installation in configure site page 2017-02-12 14:19:31 -06:00
TestSuites Issue #2499239 by Mile23, neclimdul, alexpott, jhedstrom, Mixologic, Crell, Xano, dawehner: Use test suite classes to discover different test types under phpunit, allow contrib harmony with run-tests 2016-06-24 18:36:21 +02:00
README.md Issue #2799053 by sanduhrs: Environment is not preserved running phpunit with a different user 2016-09-19 12:36:14 +01:00
bootstrap.php Issue #2605664 by Torenware, Mile23, alexpott, Taran2L, neclimdul, Yogesh Pawar, mark.creamer, donquixote, dawehner, klausi: Align TestDiscovery and bootstrap.php's non-permissive loading of PSR-4 namespaces for traits 2017-02-02 16:37:31 +00:00

README.md

Running tests

Functional tests

  • Start PhantomJS:
    phantomjs --ssl-protocol=any --ignore-ssl-errors=true ./vendor/jcalderonzumba/gastonjs/src/Client/main.js 8510 1024 768 2>&1 >> /dev/null &
    
  • Run the functional tests:
    export SIMPLETEST_DB='mysql://root@localhost/dev_d8'
    export SIMPLETEST_BASE_URL='http://d8.dev'
    ./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=<your-user>
export APACHE_RUN_GROUP=<your-group>

Example for Mac:

User <your-user>
Group <your-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 -E ./vendor/bin/phpunit -c core --testsuite functional
sudo -u www-data -E ./vendor/bin/phpunit -c core --testsuite functional-javascript