MAC OSX狮子PHPUnit的要求(/usr/lib/php/PHPUnit/Autoload.php)

Cor*_*win 3 pear phpunit osx-lion

我正在迁移到同时从雪豹到狮子的新计算机.phpunit似乎没有进行迁移,所以我重新安装了它.然而,与梨的标准安装似乎不适用于我的家庭brew安装的PHP.这是错误:

phpunit
PHP Warning:  require(/usr/lib/php/PHPUnit/Autoload.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 43

Warning: require(/usr/lib/php/PHPUnit/Autoload.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 43
PHP Fatal error:  require(): Failed opening required '/usr/lib/php/PHPUnit/Autoload.php' (include_path='.:/Users/bimemployee/pear/share/pear:/usr/lib/php') in /usr/bin/phpunit on line 43

Fatal error: require(): Failed opening required '/usr/lib/php/PHPUnit/Autoload.php' (include_path='.:/Users/bimemployee/pear/share/pear:/usr/lib/php') in /usr/bin/phpunit on line 43

我的计算机设置我的主/etc/php.ini文件作为/usr/local/etc/php.ini中的home brew php.ini文件的符号链接,这包含我的包含路径,它似乎正在工作.

php -r 'foreach (explode(":", get_include_path()) as $path) echo $path . PHP_EOL;'
No log handling enabled - turning on stderr logging
Cannot find module (LM-SENSORS-MIB): At line 0 in (none)
.
/Users/bimemployee/pear/share/pear
/usr/lib/php

我也设置php通过.bash_profile文件使用自制程序版本.

export PATH="$(brew --prefix)/bin:$PATH"
which php
/usr/local/bin/php
which phpunit
/usr/bin/phpunit

谢谢你的帮助.

-Cory

MoO*_*oOx 6

也许你没有最新版本或完整的phpunit安装.您需要使用所有依赖项安装--alldeps 所以你应该像这样安装phpunit:

pear channel-discover pear.symfony.com # for Yaml dependency
pear channel-discover pear.phpunit.de
pear install --alldeps phpunit/PHPUnit
Run Code Online (Sandbox Code Playgroud)

这项工作对我来说;)