Windows support
jmkgreen opened this issue · 3 comments
Trying to do some testing on my Windows workstation but PHP_Invoker does not install (pcntl not supported).
PHP_Unit appears to require PHP_Invoker however. Is Windows simply not going to work as a testing platform or am I not following something..?
PHP_Invoker is an optional dependency of PHPUnit. The feature of PHPUnit that depends on PHP_Invoker is not available when PHP_Invoker (or its dependency ext/pcntl
) is not installed.
This is depends on current Autoload procedure (Mine for example throws exceptions if no class found), so PHPUnit fails to start.
The issue with custom autoloaders can be easily avoided by setting the optional second parameter of class_exists on line 409 in GlobalState.php to false. That is how I got PHPUnit to work on Windows with a project that uses a custom autoloader (which also throws an exception).
so PHPUnit\Util\GlobalState.php line 409 from
if (!class_exists($className)) {
to
if (!class_exists($className, false)) {
and it will work, on windows, with a custom autoloader.
This might be a change worth using anyway, as it does not seem to break anything else.