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
So how does the transaction trait in this package work if the code called in the test starts a new transaction and commits it. In this case could a rollback work?
If not does that mean this trait can only be used to test code that doesn't use transactions?
The text was updated successfully, but these errors were encountered:
I don't think you should be using multiple transactions at all when running integration tests! You are testing a single feature of an application and this can mean multiple database calls. However you only want to start the transaction before the test and rollback when the test is done (if it succeeds or not).
It's a trait which you use in your code. If you already use transactions in your code, you simply don't use the trait. I don't think there is a way to get around this, since it's MySQL that's doing this. Not the package or in this case the database provider in Laravel
Sorry to open an issue without running any code but i think i have enough info to ask what others may be wondering.
Mysql seems to commit open transactions when a new one is open. http://stackoverflow.com/questions/1490846/mysql-transactions-within-transactions
So how does the transaction trait in this package work if the code called in the test starts a new transaction and commits it. In this case could a rollback work?
If not does that mean this trait can only be used to test code that doesn't use transactions?
The text was updated successfully, but these errors were encountered: