Mac - 安裝 phpunit
--
* 安裝 phpunit
官網:https://phpunit.de/
P.S. 因為 phpunit 5.1 版只能在 php5.6 環境執行,所以選擇 phpunit 4.8 的版本

$ wget https://phar.phpunit.de/phpunit-old.phar
$ chmod +x phpunit.phar
$ sudo mv phpunit.phar /usr/local/bin/phpunit
$ phpunit --version

PHPUnit 4.8.21 by Sebastian Bergmann and contributors.

* 切換到一個 Laravel 專案的目錄,測試一下
$ cd {laravel_project_dir}
$ phpunit
PHPUnit 4.8.21 by Sebastian Bergmann and contributors.

.

Time: 222 ms, Memory: 24.25Mb

OK (1 test, 2 assertions)

這樣基本的 phpunit 環境就裝好了!

* 安裝 phpunit-watchr 來監控測試
官網:https://www.npmjs.com/package/phpunit-watchr

安裝
$ sudo npm install -g phpunit-watchr

監控
$ cd {laravel_project_dir}
$ phpunit-watchr [path] [phpunit-configuration]
arrow
arrow
    全站熱搜

    wbkuo 發表在 痞客邦 留言(0) 人氣()