Improved test syntax with fluent API#8
Improved test syntax with fluent API#8stephpy merged 11 commits intoatoum:masterfrom jubianchi:custom-asserters
Conversation
|
👍 Uses of a library like |
|
Yeah ! I use something like that in my pro projects but without the fluent interface. Why Guzzle ? Symfony crawler is quite good for testing API. |
|
@FlorianLB you are right, let's stay on symfony context, i used guzzle and i found this library very useful but crawler will be sufficient. |
|
The crawler could also be abstracted to let the end user choose which one he wants to use. |
|
This is really nice. Since it's a Symfony bundle, the hard requirement of the Symfony crawler is okay. Yet we could enhance this later with an Interface Requirement or something like that :) Good job. |
|
I added a gist (https://gist.github.com/4336789) where I'll put updated examples while I'm working on this PR. |
|
I updated the gist linked in my previous comment with some cool stuff. As I did in another PR on atoum (atoum/atoum#151), I had to rely on an At the moment, I don't know how to do things without this keyword. In some cases, the What do you think of this Another thing that can be omitted : you can avoid typing the |
|
IMO Awesome work @jubianchi ;) |
|
There is a BC ( Nice job, ready to merge ? |
|
@FlorianLB I think it's good to merge but it's missing an asserter on the headers. By the way, if you want to merge this as is, ou can but I think it would be better to give it a try by checking ou the branch locally and using it in some tests. and a review of the code would also be really nice too ;) |
|
My previous comment is wrong : after reviewing my commit I saw I already wrote the missing headers asserter. Sorry, I'm a bit confused as I'm tired and sick :s |
|
Awesome work ! 👍 |
|
I did some review/tests, looks fine. It can be improved to be extend more easily (add new HTTP verbs, use a custom response asserter, etc) but can be done in a second time. I will try to add some docs tonight. Go merge ? |
|
ok go :) |
|
Let's go \o/ |
Improved test syntax with fluent API
|
Thank you @jubianchi ;) |
|
Nice work ;-) |
|
Nice one @jubianchi |
What do you think of something like that ?
https://github.com/jubianchi/AtoumBundle/tree/custom-asserters#test-a-controller