Testing code that uses transactions
Parts of my code uses transactions, but using artisan test or Testbench will always result in the TRANS2 exception.
How do you guys test those code? I will need a code example please. Thank you.
Difficult to know without any relevant code.
Are you nesting transactions or have you forgotten to commit/rollback a transaction in the code being tested?
How do you manage the test database; are you using one of the LazilyRefreshDatabase or DatabaseTransactions traits?
Please or to participate in this conversation.