LiipTestFixturesBundle icon indicating copy to clipboard operation
LiipTestFixturesBundle copied to clipboard

Ability to load fixtures once before test class

Open Kwadz opened this issue 8 years ago • 2 comments

Currently we can load fixtures:

  • before each test case using PHPUnit setup()
  • once before all tests by customizing Symfony bootstrap process like I suggested in liip/LiipFunctionalTestBundle#303

Only the possibility to load fixtures once before test class is missing (like we do with PHPUnit setupBeforeClass()).

So, I would like to add this ability by implementing a simple flag and a $once parameter in methods like loadFixtureFiles() as follows:

public function loadFixtureFiles(array $paths = array(), $append = false, $omName = null, $registryName = 'doctrine', $once = false)

What do you think?

Kwadz avatar Mar 24 '17 14:03 Kwadz

It may be possible with #81 or we could add another event for that.

alexislefebvre avatar Jan 13 '21 13:01 alexislefebvre

With the 2.x release, we removed the trait and moved the fixtures loading to a service. Could the service could be called in setupBeforeClass()?

alexislefebvre avatar Jul 20 '21 20:07 alexislefebvre