$ wget http://phar.phpunit.cn/phpunit-6.2.phar
$ chmod +x phpunit-*.phar
$ sudo mv phpunit-*.phar /usr/local/bin/phpunit
$ phpunit --version
/usr/bin/env: php: No such file or directory
需要配置php环境
$ vi ~/.bash_profile
PATH=$PATH:{$phpPath}/php/bin
export PATH
$ source ~/.bash_profile
$ php -version
PHP 7.0.33 (cli) (built: Aug 19 2019 18:13:42) ( ZTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.33, Copyright (c) 1999-2017, by Zend Technologies
$ phpunit --version
PHPUnit 6.5.3 by Sebastian Bergmann and contributors
请检查是否正确安装xdebug
$ php -i | grep xdebug
没有安装需要配置
vi {$phpPath}/php/etc/php.ini
zend_extension="{$path}/xdebug.so"
xdebug.remote_enable = 1
xdebug.remote_connect_back = 1
xdebug.remote_port = 9000
xdebug.max_nesting_level = 500
reportsPath}/reports --whitelist ./{ cd ./{$reportsPath}/reports
$ php -S 0.0.0.0:8899
浏览器打开 http://{$hostname-i}:8899
参考资料
PHPUnit文档-官方文档
网友评论