phar-io/version

Make testing autoload building more obvious

dnaber-de opened this issue · 2 comments

After performing the typical »on boarding« steps (cloning, run composer install) I would assume that I can run the PHPUnit tests, but it gives me the following error:

$ phpunit 
PHPUnit 6.0.6 by Sebastian Bergmann and contributors.

Cannot open file "/var/www/projects/php/phpunit/vendor/phar-io/version/src/autoload.php".

In order to run the PHPUnit tests of this package I need to do the following steps:

  • Installing phpab: $ composer global require theseer/autoload
  • Run phpab and save the result in src/autoload.php: $ phpab src/ > src/autoload.php

This is not really obvious, however. In order to automate this process, one could add phpab as dev dependency and run the autoload building as post-install composer script. Alternatively one could use the composer autoload file vendor/autoload.php.

Actually, all you would have needed to do would have been

ant setup

which will install the tools via phive and generate the autoloader.

Since particularly this project does not have any code level external dependencies, I'd like to not rely on composer to work on it.

Granted though, we need to document that :)

I guess we'll stick with the ant approach. Thanks for the effort though!

We might enhance the build.xml with a notice in case phive is missing rather than have the java stack trace shown.