I had an API that I wrote tests for with phpunit (It is in Laravel if that makes any difference)
We had to change this API to work via JSONP, which was not that tricky.
However obviously all the tests are broken. They expect json packets and are getting jsonp.
I can't find any libraries or support for testing jsonp apis. It doesn't sound too tricky to add a callback to the request and parse the response, so am am curious as to why this has not been done.
I'm happy to write my own code to do this, but figured there must be something that does it already.
I ran into a similar problem when I started working on my Api framework. Part of the answer here is not to use Unit tests. These should only test a single method. Where dependencies on other classes exist, you should mock them. Unit tests on those classes will let you know if they work.
For testing sending data to a server and what the actual result is, I'd suggest Behat. You can use this with Selenium which will actually allow you to run the JS, however this is a) difficult to set up, b) slow.
As an alternative, I used Guzzle, and this is my Feature Context:
https://gist.github.com/Gisleburt/54e4a3b70b665c8ee053
This isn't a perfect answer to your problem as you would need to trim the response for PHP to be able to read the JSON, but it will be much faster than using Selenium.