php 意思是:“您的XML配置验证了一个过时的模式,使用“--migrate-configuration”迁移您的XML配置!”

trnvg8h3  于 2023-03-11  发布在  PHP
关注(0)|答案(2)|浏览(211)

我已经在一个测试的普通PHP项目中包含了PHPUnit,当我用vendor/bin/phpunit开始测试时,我得到了下面的错误消息:
Your XML configuration validates against a deprecated schema. Migrate your XML configuration using "--migrate-configuration"!

**问题:**此错误消息是什么意思?如何避免此错误?
我的phpunit.xml文件:

<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
         bootstrap="vendor/autoload.php"
         colors="true"
         verbose="true"
         stopOnFailure="true"
>
    <testsuites>
        <testsuite name="Unit">
            <directory suffix="Test.php">./tests/Unit</directory>
        </testsuite>
    </testsuites>
</phpunit>

我使用phpunit 10

"require-dev": {
        "phpunit/phpunit": "^10.0"
    }
ee7vknir

ee7vknir1#

在下面尝试一次,read more here

<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
         bootstrap="vendor/autoload.php"
         colors="true"
         verbose="true"
         stopOnFailure="true"
>
    <include>
        <directory suffix="Test.php">./tests/Unit</directory>
    </include>
</phpunit>
but5z9lq

but5z9lq2#

运行vendor/bin/phpunit --migrate-configuration

相关问题