Search code examples
phpphpunitclassloadercomposer-php

PHPUnit testing project generated with Composer


I have a project generated with Composer which has a dependency on PHPUnit. Now I have

  • dir1 -> PHPUnit stuff
  • dir2 -> project stuff

If I go into the project directory and run PHPUnit, it complains about loading ClassLoader.php twice:

  • PHPUnit requires it in vendors/autoload.php
  • The application code (bootstrap) requires it

How can I resolve this double-inclusion?


Solution

  • From a certain composer version [citation needed], class loader got "namespaced" with a long name, thus enabling more composer based projects to work together, this is a non issue from that point on.