通过终端在 linux 上安装旧版本 oh phpunit

Install older version oh phpunit on linux through terminal

我正在尝试在仍在使用 PHP 5.5.9

的 linux/vagrant 环境中安装旧版本的 phpunit

当前版本的phpunit需要PHP5.6

我想使用 phpunit 版本 4.8 而不是 5.1

我试过了

composer global require "phpunit/phpunit=4.8.*"

但我仍然得到

This version of PHPUnit requires PHP 5.6; using the latest version of PHP is highly recommended.

我没有从 phpunit 文档中看到如何通过终端执行此操作。

感谢任何帮助。

-- 谢谢。

当您在 composer global require "phpunit/phpunit=4.8.*" 之后调用 PHPUnit 时,您确定您实际上使用的是 ~/.composer/vendor/bin/phpunit 而不是 $PATH 上的 phpunit 二进制文件吗?