考虑这个简单的例子:
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
class DefaultControllerTest extends WebTestCase
{
public function testIndex()
{
$client = static::createClient();
$client->request('GET', '/');
$this->assertEquals(200, $client->getResponse()->getStatusCode());
}
}
通过PHPUnit执行此操作时,我收到以下警告
Autowiring services based on the types they implement is deprecated since Symfony 3.3 and won't be supported in version 4.0. You should rename (or alias) the "test.client.history" service to "Symfony\Component\BrowserKit\History" instead: 1x
1x in KitaControllerTest::testIndex from Tests\AppBundle\Controller
如何修复此警告,因为这是在Symfony的核心中声明的。
我正在运行Symfony 3.4.3