-
Go to Languages && Frameworks > PHP > Test Frameworks
-
Click + button and select PhpUnit by Remote Interpreter
-
Si no tienes alguno de ddev creado, click el en botón con tres puntos "..." y se debe crear uno sobre service web Ddev, caso contrario selecciona el interprete basado en el servicio web de Ddev. click Aceptar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Check if a string has accents | |
*/ | |
function has_accent(string $string) { | |
$result = FALSE; | |
if (preg_match('/[\x80-\xff]/', $email)) { | |
$result = TRUE; | |
} | |
return $result; |
gh
Drupal's default behavior is to redirect the user to the full display of a node after it has been saved.
If you want to stay in the edit form after saving, add this snippet to a custom module adjusting the module namespace in the two functions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get into the master branch | |
git checkout master | |
# create a new branch for the changes and check it out | |
git checkout -b dev_branch | |
# stash the changes until we revert master | |
git stash | |
# go back to master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Falsy Values (using !!) | |
The empty string "" | |
null | |
undefined | |
The number 0 | |
The number NaN | |
The Boolean false | |
Truthy | |
The String "0", " ", "false" |
NewerOlder