Closed curtis1000 closed 8 years ago
Just catch the exception?
The exception doesn't stop the rest of the deletions from happening, we continue deleting, then throw at the end.
You could also make an assertion on the number of failures.
I will assert the number of failures, that should clear things up, thank you!
My suite automatically runs
FactoryMuffin::deleteSaved()
to clean up models after tests have run.I run into trouble when I have a test that need to delete models manually as a part of the test. A
DeletingFailedException
is being thrown, and I do understand why that's happening.Since my test needs to delete a model manually, I need a way to tell
FactoryMuffin
that a certain model should be skipped over when it attempts todeleteSaved()
.That could be a accomplished a few different ways. It could be an option passed into the
create()
method, or it could be simply adding a getter/setter for the$saved
collection, allowing my test to do the work of filtering the list of objects to be deleted later.