Problem/Motivation
I have some doubts on these tests... what's the purpose of looping through
foreach (['field', 'filter', 'argument', 'sort'] as $handler_type) {
to have
$display->expects($this->atLeastOnce())
->method('setOption')
->with($this->anything(), [
? In the end, it will just pass if the method is only called once, but I suppose we expect at least to be called once per handler.
Proposed resolution
Fix the test so it makes sense.