thephpleague / factory-muffin

Enables the rapid creation of objects for testing
https://factory-muffin.thephpleague.com/
MIT License
531 stars 72 forks source link

[3.0] [Proposal] Delete Saved On Descruct #337

Closed GrahamCampbell closed 9 years ago

GrahamCampbell commented 9 years ago

Should we deleteSaved in __destruct. That would be quite a cool feature, but, for example would require hhvm 3.3+ for hhvm users, but should work on all supported php versions.

scottrobertson commented 9 years ago

I would leave it up to the user. We have a flag we can pass to phpunit that leaves data intact after tests so we can inspect it if needed. This would break that feature.

GrahamCampbell commented 9 years ago

Sure.

scottrobertson commented 9 years ago

Nice idea though. I guess it could still be called in __destruct if the user has set them to delete?

GrahamCampbell commented 9 years ago

Nah, it's fine as it is. It might be really confusing for some people if we changed this.