Some developers like to install phpunit globally and not add it as a development dependency because of the high number of dependency phpunit has.
When in that case, the lookup for an autoload file returns ~/.composer/vendor/phpunit/phpunit/../../autoload.php rather than the project's autoload file. This could be easily solved if we assume that phpunit is always run from the project root, by looking first in the current working directory. The original discussion is here