Reputation: 3583
I want to test some functions in a php file, but that code is not in a class. Can I still test it with PHPUnit?
Upvotes: 1
Views: 108
Reputation: 18964
You could create a utility class that calls the functions.
class GlobalFunctions {
public function call_your_function($a, $b, $c) {
return yourfunction($a, $b, $c);
}
}
And then write tests for that class.
Upvotes: 1