自从我Symfony 2
更新到2.7
.我得到了很多过时erors的PHPUnit
和console
(信息是明确的现在).
ProjectX\ApiBundle\Tests\Controller\SectionsControllerTest::testPostDebug()
The twig.form.resources configuration key is deprecated since version 2.6 and will be removed in 3.0. Use the twig.form_themes configuration key instead.
Run Code Online (Sandbox Code Playgroud)
知道如何禁用它们吗?
我正在设置一个Symfony 4.2.2应用程序,并且想要使用Gitlab-CI运行功能测试。但是我面临着这个问题:
A tree builder without a root node is deprecated since Symfony 4.2 and will not be supported anymore in 5.0.
奇怪的是,我在本地遇到此问题,但是只有在缓存重建后第一次运行单元测试时才出现。第二次运行单元测试时,不再触发错误。
我使用SENSIO /框架-EXTRA束的5.2.4版本,它应该有解决这个问题,因为说这里。
此错误使我的工作每次都失败,即使所有测试都可以。
我确保Symfony\Bundle\FrameworkBundle\Test\WebTestCase
在功能测试中使用该类。我还确保所有依赖项都是最新的。
这是我编写的功能测试的示例:
<?php
namespace App\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
/**
* Class MigrationControllerTest
*
* @group functional
*/
class MigrationControllerTest extends WebTestCase
{
public function testNotAllowed()
{
$client = static::createClient();
$client->request('UPDATE', '/migrate');
$this->assertEquals(405, $client->getResponse()->getStatusCode());
}
}
Run Code Online (Sandbox Code Playgroud)
这是我的CI配置:
image: my.private.repo/images/php/7.2/symfony:latest
cache:
paths:
- vendor/
before_script:
- composer install
services:
- mysql:5.7
unit_test:
script: …
Run Code Online (Sandbox Code Playgroud)