You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I was looking for a tool for my current project and I have found Codeception. Everything works for my need and I really like it, except one thing:
I want to write tests and manipulate database from tests. In Db module I'm missing option to delete records from the table, something similar to (delete all records in posts table with specified title): $I->clearInDatabase('posts', [ 'title' => 'Top 10 Testing Frameworks' ]);
I don't believe I'm the first who needs it.
Maybe there is some fundamental reason not to have such functionality in the module?
The only option I see is to use dump and run it before each test. But I need to recreate whole database to make application work. IMHO to do it before each tests it is to time consuming.
So maybe I'm missing or don't understand something.
I hope I was clear enough with the question.
Thank you in advance.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I was looking for a tool for my current project and I have found Codeception. Everything works for my need and I really like it, except one thing:
I want to write tests and manipulate database from tests. In Db module I'm missing option to delete records from the table, something similar to (delete all records in posts table with specified title):
$I->clearInDatabase('posts', [ 'title' => 'Top 10 Testing Frameworks' ]);
I don't believe I'm the first who needs it.
Maybe there is some fundamental reason not to have such functionality in the module?
The only option I see is to use dump and run it before each test. But I need to recreate whole database to make application work. IMHO to do it before each tests it is to time consuming.
So maybe I'm missing or don't understand something.
I hope I was clear enough with the question.
Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions