-
Environment variables:
export SIMPLETEST_DB=mysql://user:pass@localhost/db_name export SIMPLETEST_BASE_URL=http://d8.dev
-
or copy
core/phpunit.xml.dist
tocore/phpunit.xml
and edit accordingly
vendor/bin/phpunit -c ./core/phpunit.xml.dist --printer="\Drupal\Tests\Listeners\HtmlOutputPrinter" ./modules/custom/my_module
vendor/bin/phpunit -c ./core/phpunit.xml --printer="\Drupal\Tests\Listeners\HtmlOutputPrinter" ./modules/custom/my_module/tests/src/Kernel/MyTestClass.php --filter=testFunctionName
- The old
core/scripts/run-tests.sh
script still works, but not recommended
- Unit
- Kernel
- Functional
- Functional Javascript
brew install phantomjs
or follow instructions on phantomjs site
In separate terminal: phantomjs --ssl-protocol=any --ignore-ssl-errors=true PATH_TO_DRUPAL/vendor/jcalderonzumba/gastonjs/src/Client/main.js 8510 1024 768 2>&1 >> /dev/null &
- Dan's blog!
- Change notice for JS testing
- PHPUnit Browser test tutorial
- Core tests
- Contrib module tests (Message, Message Notify, Message Subscribe, Message Digest for instance)