Skip to content

Relationships do not behave normally in my functional tests when I load fixtures with the Liip\TestFixturesBundle and HautelookAliceBundle

License

Notifications You must be signed in to change notification settings

CedCannes/sf_bug_collections_empty_during_tests_with_fixtures

Repository files navigation

Abnormal behavior of relations during tests

using liip/test-fixtures-bundle and hautelook/alice-bundle

Abnormal behavior:

I have 2 entities Board and Lane that have a OneToMany relationship. Everything works normally with the entities loaded from the database. However, I had problems with my tests if I load the fixtures before, the collections are empty when they should contain data.

To demonstrate the bug I started from the Symfony Docker to make it easier to reproduce the bug. I removed caddy and postgres since they are not necessary to see the bug.

There is a Makefile, so to see the bug, you can do :

make dev-up

make test

Solution:

Well I think it come from theofidry/AliceDataFixtures peristerloader. I have to add the following code after have loaded the fixtures and tests pass: static::getContainer()->get('doctrine')->getManager()->clear();

About

Relationships do not behave normally in my functional tests when I load fixtures with the Liip\TestFixturesBundle and HautelookAliceBundle

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published