firesphere

Also, it saves you from running through the entire form for every test, you just throw your dataset at the handler (which should be public or reflected via ReflectionClass();)

firesphere

That's not a unit test (a unit covers a bunch of methods/classes), but a functional, specifically for one form.

firesphere

Ah, I'd go with a functional test for that. Feed a bunch of different datasets to the handling function and test if the data is saved as expected.

firesphere

Find someone with some experience with Behat near you, and within 5 minutes, you are probably up to speed.

firesphere

Also, install SilverStripe-Behat, which has a lot of default behaviours and even Email-sending to test with Behat 😉