不推荐使用 composer require-dev 安装 phpunit?
Install phpunit with composer require-dev not recommended?
在我的 composer 包中,如果我的包中有 php 单元测试,我将 phpunit 添加到 composer.json
的 require-dev 部分。
今天我注意到大多数使用 php 单元测试的 php 库没有在 require-dev 中列出 phpunit。
谁能告诉我为什么?不建议用composer require-dev安装phpunit吗?
作曲家文档说
require-dev (root-only)
Lists packages required for developing this package, or running tests, etc.
所以根据我的理解 php单元应该与 composer require-dev 一起安装
IMO 将 phpunit 添加为 require-dev 依赖项是正确且方便的。
作为一个例子,它被添加到 Doctrine composer.json:
https://github.com/doctrine/doctrine2/blob/master/composer.json
在我的 composer 包中,如果我的包中有 php 单元测试,我将 phpunit 添加到 composer.json
的 require-dev 部分。
今天我注意到大多数使用 php 单元测试的 php 库没有在 require-dev 中列出 phpunit。
谁能告诉我为什么?不建议用composer require-dev安装phpunit吗?
作曲家文档说
require-dev (root-only)
Lists packages required for developing this package, or running tests, etc.
所以根据我的理解 php单元应该与 composer require-dev 一起安装
IMO 将 phpunit 添加为 require-dev 依赖项是正确且方便的。
作为一个例子,它被添加到 Doctrine composer.json:
https://github.com/doctrine/doctrine2/blob/master/composer.json