function testTotalWithVat() {
$result = calculateTotal(1000, 0.16);
if ($result !== 1160.0) {
throw new Exception("Expected 1160, got $result");
}
}That is the whole idea. Frameworks add convenience, not concept.
It is changing code in six months without fear. Without tests, every refactor is a gamble and you end up avoiding improvements you can see are needed.
Tests are code you also maintain. Fifty brittle tests that break on every change get deleted or ignored. Ten tests around money and permissions get trusted, and that is the version worth having.