Answer the question
In order to leave comments, you need to log in
Unit tests of models, how to prepare the base?
Good afternoon.
There is a project on Yii. I'm trying to set up unit tests. But the question arose, how to reset the base to its original state?
I tried fixtures - they don't fit. there are many selections from 5-8 related tables. Therefore, it would be easier to have a database dump ready and work with it.
Tell me, will it be normal to describe the entire database in the init script (most likely, import from the sql file), and then perform all tests on this copy? At the same time, wrap each test in a transaction so that it does not change anything?
Am I thinking in the right direction? Or should it be done differently?
Answer the question
In order to leave comments, you need to log in
I tried fixtures - they don't fit. There are a lot of selections from 5-8 related tables.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question