终端只告诉我There was 1 Warning:。但是我怎样才能看到完整的警告消息以及它是从哪里触发的呢?

--- 这是我的 phpunit.xml 文件
<?xml version="1.0"?>
<phpunit
colors="true"
verbose="true"
stopOnFailure="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
>
<testsuites>
<testsuite name="tests">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>
Run Code Online (Sandbox Code Playgroud) 这是我的 PhpUnit 测试类:
<?php
namespace tests\AppBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class SendEmailControllerTest extends WebTestCase
{
public function testMailIsSentAndContentIsCorrect()
{
$client = static:: createClient();
...
}
}
Run Code Online (Sandbox Code Playgroud)
但是当我尝试运行它时,我得到了一个错误,其跟踪是:
Unable to guess the Kernel directory.
C:\myProject\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Test\KernelTestCase.php:62
C:\myProject\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Test\KernelTestCase.php:138
C:\myProject\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Test\KernelTestCase.php:184
C:\myProject\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Test\KernelTestCase.php:165
C:\myProject\vendor\symfony\symfony\src\Symfony\Bundle\FrameworkBundle\Test\WebTestCase.php:33
C:\myProject\tests\AppBundle\Controller\SendEmailControllerTest.php:12
ERRORS!
Tests: 1, Assertions: 0, Errors: 1.
Remaining deprecation notices (3)
1x: Using the KERNEL_DIR environment variable or the automatic guessing based on the phpunit.xml / phpunit.xml.dist file location is deprecated since Symfony 3.4. Set the KERNEL_CLASS environment variable to the fully-qualified class …Run Code Online (Sandbox Code Playgroud) 我正在 travis ci 上运行一些 PHPUnit 测试,它告诉我它正在以代码 1 退出...我已在本地尝试过此操作,并已确认它正在以代码 1 退出。
问题是,它没有显示任何错误,没有警告,只是弃用。
这是输出
PHPUnit 8.3.5 by Sebastian Bergmann and contributors.
Testing Project Test Suite
............................................................... 63 / 118 ( 53%)
....................................................... 118 / 118 (100%)
Time: 51.24 seconds, Memory: 58.50 MB
OK (118 tests, 444 assertions)
Remaining indirect deprecation notices (13)
1x: The "DAMA\DoctrineTestBundle\PHPUnit\PHPUnitListener" class implements "PHPUnit\Framework\TestListener" that is deprecated Use the `TestHook` interfaces instead.
1x in DebugClassLoader::loadClass from Symfony\Component\Debug
1x: The "DAMA\DoctrineTestBundle\PHPUnit\PHPUnitListener" class uses "PHPUnit\Framework\TestListenerDefaultImplementation" that is deprecated The `TestListener` …Run Code Online (Sandbox Code Playgroud) 我目前正在我的 Symfony 应用程序中引入测试。其中一些失败了,需要很长时间才能运行它们。
是否可以使用 simpl-phpunit 命令运行单个测试?
与我的测试的命名空间,但最终得到
./vendor/bin/simple-phpunit App\tests\Controller\DefaultControllerTest
Run Code Online (Sandbox Code Playgroud)
无法打开文件“ApptestsControllerDefaultControllerTest.php”。
并通过我的测试的相对路径,它会导致:
./vendor/bin/simple-phpunit tests/Controller/DefaultControllerTest
Run Code Online (Sandbox Code Playgroud)
无法打开文件“tests/Controller/DefaultControllerTest.php”。