Prehistory
On some "non-very good" hosting, they like to have no alternative to disable certain functions via php.ini . In particular, sometimes useful parse_ini_file . In his project (the lightweight skeleton api) went around this way:
if (function_exists('parse_ini_file')) { self::$settings = parse_ini_file(PROPERTIES); return; } $content = preg_grep("/^[\w .]+=.*/", explode(PHP_EOL, file_get_contents(PROPERTIES))); foreach ($content as $row) { $row = strstr($row . ';', ';', true); $key = trim(strstr($row, '=', true), " \n\r"); $value = trim(strstr($row, '=', false), " \"=\n\r"); self::$settings[ $key ] = $value; } Question
How do I now tie PHPUnit to test a piece of code with a handwritten parser?
It would be ideal to run it at runtime, but I couldn’t find any info.
PS Actually, I am at the very beginning of learning PHPUnit and maybe there is a true way that I just don’t know.
runkitcan be used. I wanted Travis to github to fasten and test there already. And if suddenly someone will use it, then the dependence onPECLcompletely unnecessary - rjhdby