ixnode/php-phpunit-printer

0.1.4 2023-03-04 00:11 UTC

This package is auto-updated.

Last update: 2024-09-04 03:25:52 UTC


README

Release PHP PHPStan PHPCS LICENSE

覆盖 PHPUnit 打印器,使用格式化输出。

1) 安装

composer require --dev ixnode/php-phpunit-printer
vendor/bin/php-phpunit-printer -V
php-phpunit-printer 0.1.0 (02-04-2023 22:33:53) - Björn Hempel <bjoern@hempel.li>

2) 使用

PHPUnit output

安装此 Composer 包后,您可以根据以下方式编辑您的 phpunit.xml:

<phpunit
    ...
    printerClass="Ixnode\PhpPhpunitPrinter\Printer"
>
    ...
</phpunit>

一个完整的 phpunit.xml 示例可能如下所示

<?xml version="1.0" encoding="UTF-8"?>

<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
         backupGlobals="false"
         colors="true"
         convertDeprecationsToExceptions="false"
         stopOnFailure="true"
         printerClass="Ixnode\PhpPhpunitPrinter\TestDoxPrinter"
>
    <php>
        <ini name="display_errors" value="1"/>
        <ini name="error_reporting" value="-1"/>
        <server name="APP_ENV" value="test" force="true"/>
        <server name="SHELL_VERBOSITY" value="-1"/>
        <server name="SYMFONY_PHPUNIT_REMOVE" value=""/>
        <server name="SYMFONY_PHPUNIT_VERSION" value="9.5"/>
        <env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled"/>
    </php>

    <testsuites>
        <testsuite name="PHPUnit Test Suite">
            <directory>tests</directory>
        </testsuite>
    </testsuites>

    <coverage processUncoveredFiles="true">
        <include>
        </include>
    </coverage>
</phpunit>

3.) 开发

git clone git@github.com:ixnode/php-phpunit-printer.git && cd php-phpunit-printer
composer install
composer test

4.) 许可证

此工具使用 MIT 许可证授权 - 有关详细信息,请参阅 LICENSE 文件。