[Tests] Move expectException
closer to the place of the expectation to avoid false positives#52157
Merged
nicolas-grekas merged 1 commit intosymfony:6.4from Oct 31, 2023