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

Testing

By editor , 2 February, 2024

Unit test with Drupal using PHPUnit (Drupal 10)

Tags

  • Drupal 8
  • Testing
  • Drupal 9
  • Drupal 10

Drupal testing framework (PHPUnit) provide 3 types of tests: UnitTest, KernelTest, FunctionalTest (JSFunctionalTest)
UnitTest : Very fast but Unit Only, without drupal.
KernelTest : Is a service test with drupal but without interfaces ans theming.

By editor , 9 July, 2020

Testing (SimpleTest) Install/Run Error

Tags

  • Drupal 8
  • Code
  • Testing

Error N°1 : PHPunit not found

If uou have a message like : Add Phpunit via composer

CAUTION : PHPunit Version >= 8 is not compatable with drupal, so use the 7

composer require --dev phpunit/phpunit:7

By editor , 19 June, 2017

Test a webpage for Retina display

Tags

  • Testing
  • CSS
  • Theming

To test retina display, just adjust the screen pixel ratio.

By editor , 7 June, 2017

Test modules using drupal "Testing" System.

Tags

  • Drupal 8
  • Code
  • Testing

SimpleTest (Testing) allow to test your drupal systems in a safe way. It's also allow you to check functionaleties, result ... of your module.

First of all you must active Testing module on your envirenement.
#Drush command:
drush en simpletest -y

By editor , 7 December, 2016

SimpleTest : Running PHPUnit tests from command line

Tags

  • Drupal 8
  • Code
  • Debug
  • Testing

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"

By editor , 31 March, 2016

SimpleTest With Drupal 8

Tags

  • Drupal 8
  • Code
  • Module
  • Testing

 

 

 

Drupal Tutorial : https://www.drupal.org/simpletest

Testing

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