Mocking php POST input

Viewed 590

I have a script that is getting POST data using

$payload = file_get_contents("php://input");

I want to use phpunit and mock the POST data. Is there a way I can do this? Maybe with the $_POST variable? I am fine with changing the way the script gets the POST data - im just not sure how I can change it so I can mock POST data for testing.

1 Answers
Related