Test date in switch

If you want to read your test date dynamically from an environment variable you could use the very same approach. Assuming your variable is called TEST_DATE and the format is dd.MM.yyyy, you’d need to replace $today with DateTime.fromFormat($env["TEST_DATE"], "dd.MM.yyyy") here.