首頁  >  文章  >  後端開發  >  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