1.要使用lumen的单元测试  

https://lumen.laravel.com/docs/5.2/testing

·使用单元测试:cd 项目目录   ,   phpunit tests

里面需要使用phpunit

https://phpunit.de/manual/current/zh_cn/installation.html

phpunit推荐使用5.6以上的php版本,现在使用的是php5.5,因此涉及到php升级, 下面列举一下升级的过程:

1.  查看现在配的的php有哪些配置

php -i | grep configure
  './configure'  '--prefix=/usr/local/app/php' '--enable-mbstring' '--with-gettext' '--with-jpeg-dir=//usr/lo
cal/libjpeg' '--with-png-dir' '--with-freetype-dir=/usr/include/freetype2/freetype/' '--enable-bcmath' '--with-mysqli=mysqlnd' '-
-with-mysql=mysqlnd' '--enable-calendar' '--enable-fpm' '--with-libdir=lib64' '--enable-ftp' '--enable-sockets' '--with-bz2' '--w
ith-curl' '--with-gd' '--with-openssl' '--with-pdo-mysql=mysqlnd'





2. 下载最新版本php5.6.3 并且解压


wget  http://www.php.net/distributions/php-5.6.3.tar.gz  
tar -zxvf  php-5.6.3.tar.gz



3. 移动旧的php


mv /usr/local/app/php  /usr/local/app/php5.5.14


4.编译安装

./configure  '--prefix=/usr/local/app/php' '--enable-mbstring' '--with-gettext' '--with-jpeg-dir=//usr/local/libjpeg' '--with-png-dir' '--with-freetype-dir=/usr/include/freetype2/freetype/' '--enable-bcmath' '--with-mysqli=mysqlnd' '--with-mysql=mysqlnd' '--enable-calendar' '--enable-fpm' '--with-libdir=lib64' '--enable-ftp' '--enable-sockets' '--with-bz2' '--with-curl' '--with-gd' '--with-openssl' '--with-pdo-mysql=mysqlnd'
make && make install

5. 安装过程参考