例如在测试期间查看实体是否真的在DB中创建。
有什么想法吗?
您可以从您的WebTestCase中执行此操作:
$em = $this->kernel->getContainer()->get('doctrine.orm.entity_manager');
更新
从你自己的评论,甚至有一个捷径(因为你将有一个客户端):
$client = $this->getClient(); $container = $client->getContainer();
和mentioned in the docs一样。