Skip to content

Integrate foundry (for testing)

LenaertsJ requested to merge integrate_foundry into master

Description of changes

On this branch this library is installed https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#using-your-factory to facilitate writing tests, mainly integration tests.

Factories can be created and used to easily create objects (without the need to use all the set methods, then persist, then flush) this makes code a lot more concise. Could be used also for making fixtures, but even if we already have fixtures it seems to be very handy for testing purposes too.

Foundry also makes it possible to reset the database, just adding use ResetDatabase. This assures that you start with a clean database.

Currently I'm still experiencing problems with my test_db setup I think so it's still hard to see Foundry at work.

Error message is Undefined object: 7 ERROR: type "geometry" does not exist ├ LINE 1: ...isNoAddress BOOLEAN DEFAULT false NOT NULL, point geometry(P... ├ ^' while executing DDL: CREATE TABLE chill_main_address (id INT NOT NULL, postcode_id INT NOT NULL, buildingName TEXT DEFAULT '' N etc...

When I look at my test-db the postgis extension is already installed. I assume that my test-db is in fact not being used? What is being used?

Issues related

Tests

An AccompanyingPeriodRepositoryTest class was made solely for trying out Foundry.

Merge request reports