I want to test so开发者_如何学运维me functions in a php file, but that code is not in a class. Can I still test it with PHPUnit?
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.
精彩评论