Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/symfony/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Symfony 3功能测试错误(内核目录或WebTestCase)_Php_Symfony_Phpunit - Fatal编程技术网

Php Symfony 3功能测试错误(内核目录或WebTestCase)

Php Symfony 3功能测试错误(内核目录或WebTestCase),php,symfony,phpunit,Php,Symfony,Phpunit,我需要这方面的帮助,文档没有帮助 我有app/AppKernel.php,我不使用自定义内核,但是功能测试不运行 phpunit.xml.dist: <?xml version="1.0" encoding="UTF-8"?> <!-- https://phpunit.de/manual/current/en/appendixes.configuration.html --> <phpunit xmlns:xsi="http://www.w3.org/2001/X

我需要这方面的帮助,文档没有帮助

我有
app/AppKernel.php
,我不使用自定义内核,但是功能测试不运行

phpunit.xml.dist:

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

<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.8/phpunit.xsd"
         backupGlobals="false"
         colors="true"
         bootstrap="app/autoload.php"
>
    <php>
        <ini name="error_reporting" value="-1" />
        <server name="KERNEL_DIR" value="app" />
    </php>

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

    <filter>
        <whitelist>
            <directory>src</directory>
            <exclude>
                <directory>src/*Bundle/Resources</directory>
                <directory>src/*/*Bundle/Resources</directory>
                <directory>src/*/Bundle/*Bundle/Resources</directory>
            </exclude>
        </whitelist>
    </filter>
</phpunit>

运行phpunit时使用
--无配置
,这会阻止phpunit加载配置文件


加载文件,或者将
内核\u DIR
设置为环境变量。

您的phpunit.xml.dist文件在哪里?谢谢,我正在通过PHPStorm右键单击->运行它。我将检查是否可以配置它
/usr/bin/php /home/jorgee/Desktop/Proyectos/Nano/proyecto-nano/vendor/phpunit/phpunit/phpunit --no-configuration /home/jorgee/Desktop/Proyectos/Nano/proyecto-nano/tests --teamcity
Testing started at 21:35 ...
PHPUnit 6.1.0 by Sebastian Bergmann and contributors.


Either set KERNEL_DIR in your phpunit.xml according to https://symfony.com/doc/current/book/testing.html#your-first-functional-test or override the WebTestCase::createKernel() method.
 /home/jorgee/Desktop/Proyectos/Nano/proyecto-nano/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php:126
 /home/jorgee/Desktop/Proyectos/Nano/proyecto-nano/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php:165
 /home/jorgee/Desktop/Proyectos/Nano/proyecto-nano/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php:146
 /home/jorgee/Desktop/Proyectos/Nano/proyecto-nano/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php:33
 /home/jorgee/Desktop/Proyectos/Nano/proyecto-nano/tests/AppBundle/Controller/Security/LoginControllerAcceptanceTest.php:19