Reputation: 242
I'm developing a project based on Symfony2 and PHPUnit. As far as I know functional tests represents what the system should do in a user perspective. But, I have some questions about this approach.
Suppose I'm testing an user registration form. So the first thing that I should to do after submit the form is to assert that the response was successful, an email was sent and probably make assertions on success page. Internally the system should store the registration date, change the user status and etc.
The question is: checking this low level of code like registration date and status should be covered by functional tests? If not, where is the best place to put this kind of tests?
Upvotes: 0
Views: 25
Reputation: 14550
if you are not forced to include it in integration tests then i recommend doing it as a unit tests. in general your tests structure should be a pyramid: http://martinfowler.com/bliki/TestPyramid.html
i would divide this test into a few:
this way you will get many unit tests and only a few integration/ui tests. and that's good. that's because maintaining functional tests requires a lot of effort and are very slow comparing to unit tests
Upvotes: 1