We use the Alice bundle for our fixtures in the behat feature tests. With the last update the order of the inserts of the entities has been changed. I don’t know how or why but it was done. But we must ensure that the entities has the expected ids.

Now we change to the Foundry package where we can be safe that the entities will be created in the expected order.

Does someone had the same problem with the Alice bundle?

#symfony #behat #feature #fixtures #php

@vansari you shouldn't rely on IDs, rather on references or particular properties...

@alessandrolai I know what you mean but if you work with API test you must rely on ids rather on referencesor particular properties.

Because you want to update or delete a resource with a specific id.

@vansari yes but you shouldn't hard code IDs in your tests, rather fetch the entity by reference and get the ID from there.
@vansari relying on specific entity ids is something that you shouldn't really do

@goetas I know what you mean but it is how it is πŸ˜‚ business tech

My problem is that the Alice bundle loads the fixtures in a random way

@vansari i know that sometimes this is how things are done, but it is our responsibility as engineers to do the right choices, so when stuff as this happens we are are on the safe side.

I personally never rely on ids or random date in my test