小编Ezy*_*cod的帖子

shopware 6 插件的单元测试未找到自定义服务

我编写了一个插件,现在我想在其中创建测试。我按照官方文档并根据我的开发环境更改了 phpunit.xml.dist 。

测试正在运行,但容器不知道我的自定义定义/存储库。是不是我设置错了什么?

我尝试在标准 Dockware 容器上运行它。

phpunit.xml.dist

<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/7.1/phpunit.xsd"
         colors="true"
         bootstrap="../../../vendor/shopware/core/TestBootstrap.php"
         cacheResult="false">

    <php>
        <ini name="error_reporting" value="-1"/>
        <server name="KERNEL_CLASS" value="Shopware\Production\Kernel"/>
        <env name="APP_ENV" value="test"/>
        <env name="APP_DEBUG" value="1"/>
        <env name="APP_SECRET" value="*"/>
        <env name="SHELL_VERBOSITY" value="-1"/>
    </php>

    <testsuites>
        <testsuite name="base">
            <directory>src/Test</directory>
        </testsuite>
        <testsuite name="employee">
            <directory>src/Components/Employee/Test</directory>
        </testsuite>
    </testsuites>

    <filter>
        <whitelist>
            <directory suffix=".php">./</directory>
        </whitelist>
    </filter>
</phpunit>
Run Code Online (Sandbox Code Playgroud)

错误:

$ bash ./bin/phpunit.sh 
PHPUnit 9.5.9 by Sebastian Bergmann and contributors.

Warning:       Your XML configuration validates against a deprecated schema.
Suggestion:    Migrate your XML configuration using …
Run Code Online (Sandbox Code Playgroud)

shopware shopware6

5
推荐指数
1
解决办法
1154
查看次数

标签 统计

shopware ×1

shopware6 ×1