Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
DatabaseTransactions trait does not function correctly when Mockery is used. #360
The DatabaseTransactions trait does not roll back correctly if Mockery::close throws an exception, as the loop over
This results in queries in tests run after taking a very long time, before finally failing with
Moving Mockery::close to the last call in the tearDown function (i.e. after the callbacks) appears to fix this, but I'm not sure if this could have any other negative impact.
To recreate this, assert something 'invalid' with Mockery and add debug statements to the tearDown method in src/Testing/TestCase.php – they will never get run for the test with the failed Mockery assertion in.
I imagine this will also be happening with the DatabaseMigrations trait, but haven't tested this.