search
HomeDevelopment ToolsphpstormHow to configure webman unit testing in phpstrom

The following tutorial column will introduce you to phpstrom docker phpunit configuration webman unit test from the phpstorm tutorial column. I hope it will be helpful to friends in need!

1. Project structure

##2 , Cli Interpreter settings

The point to note here is the configuration of the mapping directory, which is a pitfall

(1) Path mappings directory configuration

Note: Remote Path is not required Configured! Note: Remote Path does not need to be configured!
Note: Remote Path does not need to be configured!

(2) Docker Container directory configuration

Note : Container Path does not need to be configured! Note: Container Path does not need to be configured!
Note: Container Path does not need to be configured!

3. Set up Test Framework

##(1) Install phpunit component library

composer require --dev phpunit/phpunit

(2) Configure unit test configuration file

##4. Configuration file

(1) phpunit.xml: unit test configuration file

<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
         backupStaticAttributes="false"
         bootstrap="tests/bootstrap.php"
         colors="true"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         processIsolation="false"
         stopOnFailure="false"
         cacheResult="false">
    <testsuites>
        <testsuite name="tests">
            <directory suffix="Test.php">./tests</directory>
        </testsuite>
    </testsuites>
</phpunit>
(2) tests: Directory to store test code

(3)tests/bootstrap.php scaffolding entrance

<?php /**
 * @desc bootstrap.php 描述信息
 * @author Tinywan(ShaoBo Wan)
 * @date 2021/11/9 18:00 */use Webman\Bootstrap;use Webman\Config;require_once __DIR__ . &#39;/../vendor/autoload.php&#39;;

Config::load(config_path(), [&#39;route&#39;, &#39;container&#39;]);if ($timezone = config(&#39;app.default_timezone&#39;)) {
    date_default_timezone_set($timezone);
}foreach (config(&#39;autoload.files&#39;, []) as $file) {    include_once $file;
}foreach (config(&#39;bootstrap&#39;, []) as $class_name) {    /** @var Bootstrap $class_name */
    $class_name::start(null);
}
(4)build: Generate test report directory

5. Start debugging.

The above is the detailed content of How to configure webman unit testing in phpstrom. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:cnblogs. If there is any infringement, please contact admin@php.cn delete

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.