atoum / AtoumBundle

This bundle provides a simple integration of atoum into Symfony 2.
MIT License
44 stars 25 forks source link

Improve DOM tree navigation #15

Open jubianchi opened 11 years ago

jubianchi commented 11 years ago

Since cfef991, AtoumBundle provides a nice fluent API to write tests. This API has some requirements that may be improved : actually, we need to add several calls to ->end() to get the right scope in assertions. This can be improved and I would like to propose a better syntax : https://gist.github.com/4336789#file-controllertest-php-L54-L83 (Two test method are implemented, one with actual API and one with the proposed one)

In the previous Gist, you'll see that quite every call to ->end() have been removed. This makes the test shorter and perhaps easier to write :

To me, this snippet is cleaner but this modification has a cost : it introduces a BC break with current tests has some assertions will not work the same way :