M
M
Mikhail Melnik2017-11-16 19:21:39
symfony
Mikhail Melnik, 2017-11-16 19:21:39

Codeception how to load fixtures into the database?

Connected on the Codeception project for api testing. Before the test, you need to load the fixtures into the database. There is a haveInDatabase() method that loads one record into the database. There is a DataFactory, which, as far as I understand, is designed for ActiveRecord. There is a Doctrine2 module, through which I tried to load data into the database, from the seeInDatabase () and seeInRepository () methods, only the latter works. So far, the only option I see is to make a custom method in ApiTester that will foreach an array with data and pull haveInDatabase() on each iteration.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question