Whilst not entirely specific to our API, testing Symfony forms is something most people seem to skip over in the real world. Whether that's right or wrong is a matter for your own project and personal opinion, but how to actually carry out a Symfony form test in Codeception isn't immediately obvious.
We will copy / paste the unit test example from the Symfony cookbook article on Unit Testing Forms and then make it fit our project. That's quite easy. There are a few little tweaks to make this work with Codeception, but the bigger question is how valuable is this unit test in terms of functionality of your project?
If you have found this video helpful, please consider sharing. I really appreciate it.
|3||GET Handled, thin Controllers and fun with Services||17:49|
|4||Automatic Route Generation||11:32|
|5||GETting a Collection||12:53|
|7||Acceptance Testing our POST Method||05:40|
|8||Unit Testing our Symfony Form||22:55|
|9||Implementing and Testing the Form Handler||03:01|
|10||POST Form Handler Implementation||11:12|