phpunit与HHVM 3.11

时间:2016-02-01 23:39:31

标签: unit-testing phpunit hhvm

根据Running phpunit tests using HHVM (HipHop)的接受答案,我试图进行一些测试:

unit-tests/ [develop] > hhvm $(which phpunit) --colors -c phpunit.xml --testsuite all .

/usr/bin/env php -d allow_url_fopen=On -d detect_unicode=Off /usr/local/Cellar/phpunit/4.3.4/libexec/phpunit-4.3.4.phar $*

看起来这是一个运行测试的命令(它确实如此),但我对此感到困惑

  1. 为什么它打印此命令而不是仅运行测试
  2. 是否执行该命令甚至使用HHVM,因为它以/usr/bin/env php ...
  3. 开头

    有没有人对此有任何见解?非常感谢!

1 个答案:

答案 0 :(得分:2)

这里发生的事情是您使用自制软件安装了PHPUnit,因此它为实际的PHAR文件创建了一个包装脚本。该包装脚本是运行PHPUnit PHAR的Bash脚本,该脚本是您尝试让HHVM运行的脚本。由于它不是PHP或Hack脚本,因此直接输出Bash脚本。

相反,您可能想尝试执行$(brew --prefix phpunit)/libexec/phpunit*.phar

例如:hhvm $(brew --prefix phpunit)/libexec/phpunit*.phar --colors -c phpunit.xml --testsuite all .

通配符是这样的,您无需指定正在使用的PHPUnit的版本。