PHPstorm configures PHPunit to unit test the PHP code introduced by composer

不言
Release: 2023-04-02 14:06:01
Original
2764 people have browsed it

This article mainly introduces PHPstorm to configure PHPunit to unit test the PHP code introduced by composer. It has a certain reference value. Now I share it with you. Friends in need can refer to it.

1. How Installing PHPunit will not be described here (if you need to break point debug testing, the xdebug extension method of installing PHP will not be discussed in detail https://xdebug.org/)

2. How to configure

Take the PHP design pattern code as an example https://github.com/domnikl/DesignPatternsPHP.git

Clone it first

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

Open again

cd DesignPatternsPHP

Install dependencies

composer install

Okay, I want to pull it down Package the debug test tracking code in the test method or test class

PHPstorm configuration is as follows

##bootstrap.php

<?php/**
 * User: szliugx@gmail.com
 * Date: 2018/7/4
 * Time: 下午6:35 */require __DIR__.&#39;/vendor/autoload.php&#39;;
Copy after login

3. How to break the debug test in the test method

The configuration is completed

The above is the entire content of this article, I hope it will be helpful to everyone Learning will be helpful. For more related content, please pay attention to the PHP Chinese website!

Related recommendations:

How to hide the version information of nginx apache php

Introduction to curl requesting other interfaces in the php interface

The above is the detailed content of PHPstorm configures PHPunit to unit test the PHP code introduced by composer. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template