phpunit - Does a global phpunit check for local version?
问题描述
I have installed phpunit globally (v7.1.4). My project uses phpunit ^6
as defined in composer.json
.
If I run $ phpunit --version
within the project dir I see:
$ phpunit --version
PHPUnit 7.1.4 by Sebastian Bergmann and contributors.
But if I run my tests another version is used:
$ phpunit
PHPUnit 6.5.7 by Sebastian Bergmann and contributors.
............. 13 / 13 (100%)
Time: 839 ms, Memory: 10.00MB
OK (13 tests, 16 assertions)
My question is: Does phpunit check for a locally installed version and uses this for the project or is my system acting weired?
解决方案
No, PHPUnit does nothing of the sort.
You have a project-local version of PHPUnit installed via Composer but do not invoke it via ./vendor/bin/phpunit
. Thus the globally installed PHPUnit is used.
推荐阅读
- twilio - Twilio 没有正确说出街道地址
- css - 具有最大高度问题的全宽 HTML5 视频
- python - 如何删除一行中的重复值?
- python - 带有对象数组的 Python 嵌套 for 循环
- laravel - 如何检查 laravel eloquent 更新方法是否成功
- javascript - 如何将 ArrayBuffer 转换为 AudioBuffer?
- c++ - 使用文件对话框选择包含特定文件类型的文件夹?
- dart - 将变量_id发送到flutter中的下一个文件
- android - l.实施admob广告时应用加载缓慢 - Android
- python - 在 keras 中使用 CRF 进行二进制分割时的形状错误