I am running PHP unit as follows:
phpunit --debug --verbose --coverage-clover=/tmp/test.xml
and get the following error:
Fatal error: Class 'PHP_Token_OPEN_TAG' not found in /opt/pear/share/pear/PHP/Token/Stream.php on line 205
The stack trace leads down to
12. PHP_Token_Stream->scan($sourceCode = '<?php\n/**\n...') /opt/pear/share/pear/PHP/Token/Stream.php:147
The source code is syntactically okay.
This class is defined in /opt/pear/share/pear/PHP/Token.php but it looks like it can not be found.
I dumped the output of spl_autoload_functions() in Stream.php:147 and found out, that there is some Aitoc autoloader.
The problem is caused by an Aitoc Magento extension.
They have a function that simply unregisters all autoloaders.