silverstripe-archive / silverstripe-newsletter

NewsletterAdmin is the CMS class for managing the newsletter system.
BSD 3-Clause "New" or "Revised" License
69 stars 59 forks source link

Composer: Could not scan for classes inside "newsletter//tests/behat/" #108

Closed dallumnz closed 8 years ago

dallumnz commented 8 years ago

Ignoring the tests folder for export creates an issue with composer when using --prefer-dist

Composer downloads the zip package without the /tests folder, however in composer.json you have "classmap": ["tests/behat/"]

resulting in

[RuntimeException]
Could not scan for classes inside "newsletter//tests/behat/" which does not appear to be a file nor a folder
tractorcow commented 8 years ago

The fix for this is to change .gitattributes to not ignore the entire tests folder, but only the non-behat folders within this.

dhensby commented 8 years ago

I think a better solution is to use https://getcomposer.org/doc/04-schema.md#autoload-dev

dhensby commented 8 years ago

Is the classmap required for the tests to run or just an efficiency issue?

tractorcow commented 8 years ago

It's required to load some classes for behat, it seems.

tractorcow commented 8 years ago

autoload-dev is root only =(

dhensby commented 8 years ago

blergh

tractorcow commented 8 years ago

Remove /tests from .gitattributes and replace with

/tests/phpcs export-ignore
/tests/travis export-ignore
/tests/unit export-ignore
dhensby commented 8 years ago

Fixed