SimpleTest : Running PHPUnit tests from command line | Drupal 8

SimpleTest : Running PHPUnit tests from command line

Submitted by editor on Wed, 12/07/2016 - 17:39
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

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.