I have an interesting problem and have searched the internet, but haven't yet found an answer.
Consider the following function:
function get_setting_values_from_file( $parameter )
{
exec("/usr/var/binary --options $parameter", $output, $return);
$settings = file( $output[0] );
}
I need to unit test a similar function. I am currently using phpUnit for my tests and the vfsStream libraries to mock the file system, but how do you mock the binary file available on the system or what is the recommend approach for dealing with test cases like this?
All feedback is appreciated.