Skip to content

bug(tests): (Symfony)ApiTestCase::createClient() boot kernel on each call #6971

@Crovitche-1623

Description

@Crovitche-1623

API Platform version(s) affected: x.y.z
3.x

Description
I don't know if it's a bug or the expected behaviour.

When I do use the RecreateDatabaseTrait from theofidry/alicebundle, the database is recreated each time the kernel is booted.

However, if I want to use multiple client (using the ApiPlatform\Symfony\Bundle\Test\ApiTestCase::createClient) or if the kernel is already booted, this cause problem because the database is recreated as the kernel is always booted without check.

IMHO, an additional check should be added to check if the kernel is already booted like the KernelTestCase::getContainer() does ?

I can take care of the PR if my issue is relevant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions