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
The DatabaseTransactions trait does not roll back correctly if Mockery::close throws an exception, as the loop over beforeApplicationDestroyedCallbacks is never executed (the exception takes us out of that context).
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.
The text was updated successfully, but these errors were encountered:
36degrees
changed the title
DatabaseMigrations trait does not function correctly when Mockery is used.
DatabaseTransactions trait does not function correctly when Mockery is used.
Feb 11, 2016
Afraid I've changed job and haven't worked with Laravel in a couple of years, and no longer have access to the source code, so I can't tell you what we did! Sorry!
The DatabaseTransactions trait does not roll back correctly if Mockery::close throws an exception, as the loop over
beforeApplicationDestroyedCallbacks
is never executed (the exception takes us out of that context).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.
The text was updated successfully, but these errors were encountered: