drupal/core/tests
xjm db5e8289f2 Issue #2572787 by alexpott, mfernea, attiks, andriyun, andypost, RoSk0, hussainweb, klausi, martin107: Fix 'Drupal.WhiteSpace.CloseBracketSpacing' coding standard 2017-10-13 12:43:15 -05:00
..
Drupal Issue #2572787 by alexpott, mfernea, attiks, andriyun, andypost, RoSk0, hussainweb, klausi, martin107: Fix 'Drupal.WhiteSpace.CloseBracketSpacing' coding standard 2017-10-13 12:43:15 -05:00
TestSuites Issue #2901744 by mfernea: Fix 'PSR2.Namespaces' coding standard 2017-10-10 16:09:51 +01:00
fixtures Issue #2728579 by Mile23, neclimdul, Munavijayalakshmi, klausi, dawehner: Explicitly skip @requires module in PHPUnit Kernel and Browser tests 2017-09-25 13:07:02 +01:00
README.md Issue #2864690 by renatog, sandeepscs, cilefen: Fix typos in core README files 2017-04-08 16:18:38 -04:00
bootstrap.php Issue #2776975 by joelpittet, dawehner, tim.plunkett, xjm, pfrenssen: March 3, 2017: Convert core to array syntax coding standards for Drupal 8.3.x RC phase 2017-03-03 19:20:24 -06: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 straightforward - 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