全局phpunit是否检查本地版本?

全局phpunit是否检查本地版本?,phpunit,Phpunit,我已经在全球安装了phpunit(v7.1.4)。我的项目使用phpunit^6,定义见composer.json 如果在项目目录中运行$phpunit--version,我会看到: $ phpunit --version PHPUnit 7.1.4 by Sebastian Bergmann and contributors. 但如果我运行测试,则会使用另一个版本: $ phpunit PHPUnit 6.5.7 by Sebastian Bergmann and contributors.

我已经在全球安装了phpunit(v7.1.4)。我的项目使用phpunit
^6
,定义见
composer.json

如果在项目目录中运行
$phpunit--version
,我会看到:

$ phpunit --version
PHPUnit 7.1.4 by Sebastian Bergmann and contributors.
但如果我运行测试,则会使用另一个版本:

$ phpunit
PHPUnit 6.5.7 by Sebastian Bergmann and contributors.

.............                                                     13 / 13 (100%)

Time: 839 ms, Memory: 10.00MB

OK (13 tests, 16 assertions)

我的问题是:phpunit是否检查本地安装的版本并将其用于项目,或者我的系统是否运行正常?

否,phpunit不执行此类操作


您通过Composer安装了PHPUnit的项目本地版本,但没有通过
/vendor/bin/PHPUnit
调用它。因此,将使用全局安装的PHPUnit。

不,PHPUnit不执行此类操作

您通过Composer安装了PHPUnit的项目本地版本,但没有通过
/vendor/bin/PHPUnit
调用它。因此,使用全局安装的PHPUnit