PHPstorm配置PHPunit对composer引入的php代码进行单元测试

 1、 如何安装PHPunit,这里不展述(如需打断点debug测试,安装PHP的xdebug扩展方法也不展开说了 https://xdebug.org/

 

2、如何进行配置

以 PHP设计模式的代码为例 https://github.com/domnikl/DesignPatternsPHP.git

先克隆下来

git colonel https://github.com/domnikl/DesignPatternsPHP.git

再打开

cd DesignPatternsPHP

安装依赖

composer install

 

好了,想对拉下来的包在测试方法或者测试类中debug测试跟踪代码

 

PHPstorm配置如下

 

bootstrap.php

<?php
/**
 * User: szliugx@gmail.com
 * Date: 2018/7/4
 * Time: 下午6:35
 */


require __DIR__.'/vendor/autoload.php';

 

3、如何在测试方法中打断点debug测试

 

配置就这么完成了

 

posted @ 2018-07-04 19:18  liugx  阅读(365)  评论(0编辑  收藏  举报