I’m new on testing, I’m using PHPUnit to write test. All the site has been designed using the MVC pattern.
I would like to test each method on my controllers, the problem is that such methods receives the parameters though the $_POST variable. How can I overwrite this variable?
Thanks in advance
Alejandra
The best approach would be to abstract the Request into a separate class and not access the superglobals at all. This way you decouple the actual server and request environment from the application. You can then mock the Request easily.