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
Recently I had a problem while writing a test for a modular Laravel 10 app.
The behavior of the DatabaseTransactions trait was really strange.
The tests that used it were failing because the trait tried to execute some migrations which isn't something that's supposed to happen.
After that, I found that the problematic migrations were the only ones in the project that weren't anonymous classes.
After I changed them to be anonymous, everything started working like it should have.
I found some articles about why Laravel switched to anonymous migration classes:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Recently I had a problem while writing a test for a modular Laravel 10 app.
The behavior of the
DatabaseTransactions
trait was really strange.The tests that used it were failing because the trait tried to execute some migrations which isn't something that's supposed to happen.
After that, I found that the problematic migrations were the only ones in the project that weren't anonymous classes.
After I changed them to be anonymous, everything started working like it should have.
I found some articles about why Laravel switched to anonymous migration classes:
In my opinion, a new expectation
->toBeAnonymous()
would have prevented that problem in my project and would be a great addition to the Arch plugin.Beta Was this translation helpful? Give feedback.
All reactions