Question
How to test drupal 8 application using command line (without SimpleTest Admin interface) ?
Initialisation - Create link to the script (Optional).
ln -s core/scripts/run-tests.sh ~/bin
Run Test and open rest in web browser.
php core/scripts/run-tests.sh --browser --class "Drupal\YOUR_MODULE\Tests\JustTest"
Run Test and display result in the terminal.
php core/scripts/run-tests.sh --verbose --color --class "Drupal\YOUR_MODULE\Tests\JustTest"
Run test using a separate SqLite Database.
php core/scripts/run-tests.sh --verbose --sqlite test.sqlite --class "Drupal\YOUR_MODULE\Tests\JustTest"
Run test verbose mode and open in web browser.
php core/scripts/run-tests.sh --verbose --browser --class "Drupal\YOUR_MODULE\Tests\JustTest
Clean up Database Tables.
php core/scripts/run-tests.sh --verbose --clean
Link : https://www.drupal.org/docs/8/phpunit/running-phpunit-tests
Add new comment