Dogpatch: HTTP API testing framework, written in PHP using curl
github.com
github.com
* Why doesn't the put() method have a parameter for the payload? Sending a PUT with headers only is .... uncommon to me.
* How can I use this to test my JSON-based API? The $postData on post() requires an array, so I cannot put in my pre-encoded JSON payload. Maybe just remove the typehint?
* prettyPrintJson() could use a version-switch and use JSON_PRETTY_PRINT in PHP 5.4+ -- results should look similar.
I'll keep this in mind, could come in handy when testing the next API ;-)
You're creating a dependency on a multi-purpose http library when you have a very specific need. Also you have a dependency on curl, but you can use guzzle without curl so you would then need to do your own check to see if curl was enabled. Better off to have it as a hard dependency and use it yourself.
Sometimes using premade libraries isn't the best option. I believe this may be one of them.
Having support for more than one back-end is always nice.