Usage - Deleting
You can delete all your saved models with the
deleteSaved function. It should be noted that you can set a custom delete function before you get going with the
If one or more models cannot be deleted, a
League\FactoryMuffin\Exceptions\DeletingFailedException will be raised after we have attempted to delete all the saved models. You may access each underlying exception, in the order they were thrown during the whole process, with the
getExceptions function which will return an array of exceptions. You may encounter the following exceptions:
League\FactoryMuffin\Exceptions\DeleteFailedExceptionwill be thrown if the delete function on your model returns false.
League\FactoryMuffin\Exceptions\DeleteMethodNotFoundExceptionwill be thrown if the delete function on your model does not exist.
- Any other exception thrown by your model while trying to delete it.
It's recommended that you call the
deleteSaved function from PHPUnit's