- Null coalescing - check for null and performs next (?? ??=)
- Ternary - check for false and performs next (?:)
if (is_string($hashesForCherryPick)) $hashesForCherryPick = explode(" ", $hashesForCherryPick);
- Functional tests only in and out. Your soft becomes black-box, it kind of user behavior simulation
- Unit tests inside of classes, how they were designed. Test component in an isolated way.
- Stubs are fake objects, thatreturns something that you expect (API response, data)
- Mocks are more advanced, they test behavior of a method (how much method was called, with what arguments, in what order)
- Parameters: Parameters are the variables listed inside the parentheses in a function's definition. They act as placeholders for the values that will be passed into the function when it's called. Think of them as the function's "input specifications."
- Arguments: Arguments are the actual values that are passed to a function when it's called. They are the real data that the function will use during its execution. Think of them as the function's "actual inputs."
<?php
function add($num1, $num2) { // $num1 and $num2 are parameters
return $num1 + $num2;
}
$result = add(5, 3); // 5 and 3 are arguments
echo $result; // Output: 8