【问题标题】:How can I run PHPUnit from git bash on Windows?如何在 Windows 上从 git bash 运行 PHPUnit?
【发布时间】:2015-02-22 21:26:38
【问题描述】:

我有 Windows 7,phpunit 是通过以下说明安装的:https://phpunit.de/manual/current/en/installation.html 并且可以在常规 cmd 终端上正常工作,但在从 git-scm 安装的 windows git bash 终端中无法识别 phpunit

我主要是一名 linux 开发人员,所以在 Windows 上设置这些东西对我来说有点陌生。

【问题讨论】:

标签: windows command-line phpunit git-bash


【解决方案1】:

我自己也遇到了同样的问题,请参阅 SuperUser https://superuser.com/a/663187 提供的这个答案,基本上问题是 Git Bash 不运行“.bat”文件:

【讨论】:

    【解决方案2】:

    使用别名 native 会好很多。编辑 ~/.bashrc,在其中添加这些:

    alias phpunit="php /C/Tools/php/phpunit.phar" // phpunit.phar in C:\Tools\php\phpunit.phar
    

    【讨论】:

      【解决方案3】:

      复制phpunit.phar文件并将dumplicate文件重命名为phpunit

      将 C:\bin\phpunit.phar 重命名为 C:\bin\phpunit

      Fix: PHPUnit not working with Git Bash in Windows

      【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-09-04
      • 2020-09-06
      • 2017-04-16
      • 2018-02-09
      • 1970-01-01
      • 2019-01-05
      • 2021-06-06
      • 2019-08-19
      相关资源
      最近更新 更多