【问题标题】:Install older version oh phpunit on linux through terminal通过终端在linux上安装旧版本oh phpunit
【发布时间】:2016-04-19 05:08:09
【问题描述】:

我正在尝试在仍在使用 PHP 5.5.9 的 linux/vagrant 环境中安装旧版本的 phpunit

当前版本的phpunit需要PHP 5.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.*" 但我仍然得到 This version of PHPUnit requires PHP 5.6;强烈建议使用最新版本的 PHP。
  • composer global require "phpunit/phpunit=4.8.*" 在 php 5.5.9 上运行良好
  • 试试composer global require "phpunit/phpunit=4.8.0"
  • @Will 4.8.04.8.21 具有相同的依赖集,因此 4.8.*4.8.0 之间实际上没有区别

标签: php linux terminal phpunit


【解决方案1】:

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

【讨论】:

  • 谢谢!当我运行 which phpunit 时,我只是想出了 ~/usr/bin/phpunit ;但你所说的完全有道理。现在需要确保我的环境中只有一个 phpunit。再次感谢您!
猜你喜欢
  • 2010-12-06
  • 1970-01-01
  • 2016-05-31
  • 1970-01-01
  • 1970-01-01
  • 2015-01-21
  • 1970-01-01
  • 2019-05-17
  • 2016-07-24
相关资源
最近更新 更多