-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Codeception didn't clean DB when inserting data through Yii2 models #4617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Do you use transactions in your models? |
@Naktibalda no, I have a regular Yii2 model:
the same for "news" |
additional info:
|
Any idea how to fix the issue? |
@amkoro this behavior has been changed
use
Codeception/src/Codeception/Subscriber/Module.php Lines 55 to 57 in b1d96da
Codeception/src/Codeception/Module/Yii2.php Lines 187 to 200 in b1d96da
Codeception/src/Codeception/Test/Cest.php Line 81 in b1d96da
|
The Yii2 module has almost been completely rewritten with respect to database cleanup / transactions. I think this can be closed. |
What are you trying to achieve?
I have a regular Yii2 models News and NewsImage. I have the only fixtures for news. Trying to write a test which will add new news item, get auto-generated id and insert new news_image item with such id.
What do you get instead?
Test executes successfully - no issues there. Table news stays empty, but table news_item have my test data (one row). It was not removed as I expected. You can see I have cleanup and transaction config options enabled, plus codeception output shows that "transaction cancelled".
Details
composer show
)The text was updated successfully, but these errors were encountered: