PHPixie Illusion is another useful testing
tool .
If your application depends on external APIs, then you must have encountered the problem of how to present them in your tests. Just this problem and solves Illusion. It creates a separate HTTP server on the specified port and allows you to easily manage its routes and results, including HTTP headers.
AND
All this is very simple:
How it works ?')
Pretty simple. In a separate process, a slightly modified StupidHTTP server is launched, to which two sockets are added for transferring notifications with the client. Having received the appropriate command, the server adds the route to its configuration.
It should be noted that since the server receives a separate process, a possible option is when the main thread ends and the server remains hanging (for example, with an exception). To avoid this behavior, you can put a call to stopServer () in the exception handler in your test.