Tag Archives: silex

Testing framework-backed APIs with PHP’s internal web server

Recently I had to prepare functional tests for a set of (RESTish) APIs in a Silex-backed application. The problem is that I couldn’t test POST, PUT and DELETE methods on the development environment or (worse) on the staging server.

So I came up with the idea of using the PHP integrated webserver, started from the PHPUnit bootstrap, and a couple of rules in the app bootstrap to redirect all storage calls to a temporary database.

Continue reading