vendredi 3 juillet 2020

Could I load fixtures from different entity managers with LiipTestFixturesBundle

I have entities which are managed by two entity managers in Symfony 4 project and I would like to load fixtures from both connections for functional tests. For instance :

class AdapterTest extends KernelTestCase
{
    use FixturesTrait;

    ...

    protected function setUp(): void
    {
        self::bootKernel();

        // Not working, just for example
        $this->loadFixtures([CounterFixtures::class], false, 'counter');
        $this->loadFixtures([CountryFixtures::class]);

        ...
    }

    ...
}

Unfortunatly, tables are dropped and only tables related to last entity manager connection are loaded.

I use LiipTestFixturesBundle v1.9.1.

Does this bundle support it or do you know how I can do that?

Aucun commentaire:

Enregistrer un commentaire