I have a legacy project that uses the "files" section inside of the "autoload" definition for some initialization. This initialization depends on some framework. What I'm trying to do is to make the few unit tests of this codebase runnable without having the framework be present. The code of my legacy project gets loaded via a mix of "psr-4" and "classmap" inside of "autoload". Furthermore, this project depends on a number of libraries loaded via Composer.
This means I can't just include the composer autoloader (vendor/autoload.php
) in my test bootstrap as I'd normally do. I've had a go at including just the classmap, namespace and psr-4 loaders in vendor/composer
, though after some digging in the Composer code found it's not that simple.
Is there a somewhat-sane way to use the Composer generated autoloader without having it include the "files" defined in the "autoload" section?
autoload_classmap.php
from thevendor/composer/
folder? I mean guess that could work. Or whatever file you need from there. – Andrei