laravel 4 - Codeception API testing: stuck at passing json payload to REST service -


i found cool tool called codeception testing in php. liking lot. started writing api test cases. stuck @ posting json payload rest service. how can perform this?

i have rest end point called /order, accepts json payload. service build on laravel4, accept payload in laravel4 using input::json()->all().

i have tried this

$filename = __dir__.'/createorder.json'; $i->havehttpheader('content-type', 'application/json'); **$i->sendpost('order', null, array($filename));**   $i->seeresponsecodeis(200); $i->seeresponseisjson(); 

but gives me 500 internal server error, service accepts json payload , not in form of file.

anyone has worked on before?

thanks in advance.

i know old question others stumble on this, try:

$i->havehttpheader('content-type','application/json');

it should work.


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -