This lesson is a "quick tip" to emphasize that you need to pick the proper assertion to get the correct assertion error.
For example, we have a simple Service for converting currencies.
app/Services/CurrencyService.php:
class CurrencyService{ const RATES = [ 'usd' => [ 'eur' => 0.98 ], ]; public function convert(float $amount, string $currencyFrom, string $currencyTo): float { $rate = self::RATES[$currencyFrom][$currencyTo] ?? 0; return round($amount * $rate, 2); }}
Then, in the unit test, we expect the...