mock-webserver
mock-webserver copied to clipboard
Simple mock web server in PHP for unit testing.
Hey @donatj, I just got your `v3wip` branch, rebased, added minor updates and it's passing through the tests.
## Current Features: - Windows Compatibility thanks to @dron2004 ## Outstanding Issues: - [ ] STDOUT/STDERR of InternalServer show on primary process in Windows
With the release of 8.0 I'm intent on upgrading all my libraries to require a minimum of PHP 7.1 (7.0 didn't have nullable type hints, so that's a no-go) This...
What if we could mock an endpoint like this `/endpoint/product/*` So then it would not matter what parameter we send in the * we would get the same response. ```PHP
This works: ```php $url = $this->server->setResponseOfPath("/api/endpoint", new Response('abc' )); $content = file_get_contents($url); print_r($content); ``` While this does not: ```php $url = $this->server->setResponseOfPath("/api/endpoint?with=parameter", new Response('def')); $content = file_get_contents($url); print_r($content); ``` Instead...
As I promised, I restored escaped command line and its arguments. And I made it for the Windows platform also.
Is it possible to support a base path for routes? This can then be mapped to a base file path for wild card routes thanks
This was just the library I was looking for to test out a HTTP client layer I was writing for an application. Enabled sockets extension in php.ini (running PHP version...