symfony / test-pack

A Symfony Pack for functional testing
MIT License
857 stars 9 forks source link

Remaining indirect deprecation notices #15

Closed karaka200 closed 2 years ago

karaka200 commented 2 years ago

When I run php ./vendor/bin/phpunit command, test is ok but display Remaining indirect deprecation notices

Testing started at 12:18 PM ...
PHPUnit 9.5.10 by Sebastian Bergmann and contributors.

Testing C:\projects\karaka\tests\Controller

Time: 00:00.619, Memory: 28.00 MB

OK (1 test, 1 assertion)

Remaining indirect deprecation notices (1)

  1x: The "Symfony\Bridge\Doctrine\Logger\DbalLogger" class implements "Doctrine\DBAL\Logging\SQLLogger" that is deprecated Use {@link \Doctrine\DBAL\Logging\Middleware} or implement {@link \Doctrine\DBAL\Driver\Middleware} instead.
    1x in ProductControllerTest::testProduct from App\Tests\Controller

Process finished with exit code 0

ProductControllerTest.php

<?php

namespace App\Tests\Controller;

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;

class ProductControllerTest extends WebTestCase
{
    public function testProduct(): void
    {
        $client = static::createClient();
        $crawler = $client->request('POST', '/product');

        $this->assertResponseIsSuccessful();
    }
}

@nicolas-grekas How can I fix this warning?

decmade commented 2 years ago

I am hitting this trying to write unit tests that use a testing logger instance as well. For the unit test in question, the logger isn't even being used directly in my code yet. What gives?

nicolas-grekas commented 2 years ago

See https://github.com/symfony/symfony/issues/44313