>  기사  >  백엔드 개발  >  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으로 문의하세요.