首页  >  文章  >  后端开发  >  phpstorm配置phpunit,进行php单元测试

phpstorm配置phpunit,进行php单元测试

不言
不言原创
2018-05-23 10:48:284203浏览

phpstorm配置phpunit,进行php接口单元测试

1。安装php5.6,phpunit5.1,curl

mac 自带的默认是php5.5,需要升级,打开终端,运行:
curl -s http://php-osx.liip.ch/install.sh | bash -s 5.6

查看phpunit官网文档,根据文档步骤

wget https://phar.phpunit.de/phpunit.phar$ chmod +x phpunit.phar$ sudo mv phpunit.phar /usr/local/bin/phpunit
$ phpunit --version
PHPUnit 5.1.3 by Sebastian Bergmann and contributors

2。下载phpunit.phar文件,然后在phpstorm 中加载,如图

phpstorm配置phpunit,进行php单元测试

第二个就是phpunit.phar的路径
phpstorm配置phpunit,进行php单元测试

3.。加载phpunit安装目录:

phpstorm配置phpunit,进行php单元测试

4.。选择编译器

phpstorm配置phpunit,进行php单元测试

5,根据curl 模拟访问接口,

&#39;).addClass(&#39;pre-numbering&#39;).hide(); $(this).addClass(&#39;has-numbering&#39;).parent().append($numbering); for (i = 1; i <= lines; i++) { $numbering.append($(&#39;
&#39;).text(i)); }; $numbering.fadeIn(1700); }); });

以上就介绍了phpstorm配置phpunit,进行php单元测试,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn