I am writing tests for a php software and i would like to know how can i mock a function (no from a class, but from a file full of functions). This function call to a build-in php function "getallheaders" but how i am using phpunit to reach that function there is no such header in the request so as a consecuence i get "Error: Call to undefined function getallheaders()".
How can i avoid that from phpunit? Remember, there is no namespaces in this software and also this particular function doesn´t belong to a class, belong to a script full of functions.
I will appreciate any help. Thanks