How to remove all tests in composer php?

后端 未结 3 2051
不思量自难忘°
不思量自难忘° 2021-02-19 23:57

I\'m new in composer development. I just start to work with composer in my current project. And I think my question is already asked before or I\'m noob about composer :D

<
3条回答
  •  无人及你
    2021-02-20 00:38

    Not directly, but if the package maintainers followed some best practises it is possible.

    Use the --prefer-dist argument for composer install and composer update, then composer will try to download the packages' distributable instead of its source. For packages on GitHub this means, it downloads a zip file instead of cloning the repository.

    It is possible that this still includes all the tests, but it is recommended to not include tests in the distributable. For packages on GitHub, tests are excluded if there is a .gitattributes file with content like:

    /tests              export-ignore
    /phpunit.xml        export-ignore
    

    Read more: I don't need your tests in my production (Reddit)

提交回复
热议问题