Title, how to test the PHP API interface, what are the options for you?
Reply content:
Title, how to test the PHP API interface, what are the options for you?
Postman
The API can be tested using PHPUnit: PHPUnit configuration and use under Windows
Chrome expands DHC
If you're using Phpstorm, there's a self-contained tool.
OSX has a very good choice, paw.
I usually use google chrome a plugin: postman to test the interface ...
Curl Command
Current Toolchain: Shell + curl + JQ + awk + sed + ... Overall or to the naked eye one by one to see the results, but the interface is not fixed also had to write a simple script to test it at random?
After settling down, I will consider using phpunit/codeception and the like to facilitate the processing of the test results.
access_token=$(curl -Ss -X POST "${baseUrl}/user/login" -H 'Content-Type:application/json' -d '{"email":"a@bcom","password":"c"}' \ | jq . | sed -n '/access_token/p' | awk '{ print $2 }' | tr -d '", ')
or Yii2-rest.
Hattip.
Paw
Paw a more complete and higher level of functionality
Chrome and Firefox also have plug-ins
If you are using PHP Storm (jetbrains home product):
menu->Tools->Test RESTful Web Service
Recommended JMeter
Tool level can be used JMeter, if the latter frame or architecture and development can be used robot framework+requestlibrary
Advanced REST Client