Skip to main content
Drupal 8

Main navigation

  • Home
    • Question And Answer
    • NEWS
    • Projects
  • Tutorials - Drupal
    • Android
    • Other
User account menu
  • Log in

Breadcrumb

  1. Home

SimpleTest : Running PHPUnit tests from command line

By editor , 7 December, 2016
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

Tags

  • Drupal 8
  • Code
  • Debug
  • Testing
SimpleTest With Drupal 8
Test modules using drupal "Testing" System.
Unit test with Drupal using PHPUnit (Drupal 10)

Comments

Plain text

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

Links

  • Drupal.org
  • Drupal core release cycle
  • Drupal events with ease
  • Unit test with Drupal using PHPUnit (Drupal 10)
  • Tokens for file upload url
  • Tips for Docker
  • CKEditor inline image files usage for custom forms.
  • Install Docker on Linux Mint
  • Install PHP 8.1
  • Drupal Security Best Practices
  • Order and sort items with tabledrag
  • Add a custom service YAML container
  • Apply a patch with composer