php - Symfony 4.4 functional test delete form not working

one text

I have an multi-delete functionality (kind of like PHPMyAdmin, checkboxes you can check to delete multiple items). The functionality itself works, but I'm implementing it in my functional test. However, somehow it doesn't work.

This is the code of my service (where multi-delete is handled, this is in a function that's called within controllers)

$form = $this->formFactory->createBuilder()->setMethod('DELETE')->getForm();
$form->handleRequest($request);

if ($form->isSubmitted() && $form->isValid()) {
    $this->deleteKeys($request);
    return new RedirectResponse($this->session->get('referer'));
}

The function renders a template with the form, a button and a list of all items being deleted. This is the template:

{{ form_start(form) }}
    <div class="row">
        <div class="col-md-12">
            <div class="box">
                <div class="box-body">
                    {{ form_widget(form) }}
                    <p>{{ 'standard.Are you sure you want to delete the following items'|trans }}?</p>
                    <p>
                        {% for item in items %}
                            <strong class="d-block">{{ item.displayProp }}</strong>
                            <input type="hidden" name="items[]" value="{{ item.id }}">
                        {% endfor %}
                    </p>
                </div>
                <div class="box-footer">
                    <input class="btn btn-danger" type="submit" name="delete_items" value="{{ 'standard.Delete'|trans }}">
                    <a class="btn btn-default" href="{{ app.session.get('referer') }}">{{ 'standard.Cancel'|trans }}</a>
                </div>
            </div>
        </div>
    </div>
{{ form_end(form) }}

So, testing it via my browser, it works completely fine. Then, lets look at the code in my test. The code to get to the confirm page works, it shows the right items selected to delete. But it contains a form:

$form = $crawler->selectButton('delete_items')->form(null, 'DELETE');
$crawler = $this->client->submit($form);

So, it selects the form based on the delete_items button name (which exists), it doesn't throw an error or something, it submits the form, but after it, getting the HTML of $crawler still displays the "deleted" items. Again, if I test the functionality in the browser in the module itself, it works, but in the functional test it somehow doesn't.

Also I tried using $this->client->followRedirect() which says the request isn't redirected. But it's just a normal delete form without validation so I don't see why it shouldn't work.

EDIT:

Apparently somehow the form isn't submitted, var_dump($form->isSubmitted()); says false. I'm not sure why it isn't submitted though since it does get submitted if I test it in the browser though.

Source