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.
Drupal 9
By editor, 4 September, 2023
By nuwantha, 1 June, 2022
By editor, 8 March, 2022
By editor, 4 November, 2021
By editor, 3 November, 2021
By editor, 30 September, 2021
PHP Class using StringTranslationTrait
StringTranslationTrait allow to get t() and formatPlural() methods
Example:
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\StringTranslation\TranslationInterface;
class MyClass {
By editor, 13 August, 2021
Tags
Import configuration file programmatically on Drupal 9 using config_update contrib module and service
//Update Module settings
\Drupal::service('config_update.config_update')->revert('system.simple', 'mymodule.settings');
By editor, 24 June, 2021
By editor, 19 January, 2021