我正在尝试设置单元测试,但每当我运行"phpunit -c app"时,我都会收到此错误:
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException:您已请求不存在的服务"test.client".
我的测试用例中的代码只是:
public function testNonAuthenticatedPathsIndex()
{
$client = $this->createClient();
}
Run Code Online (Sandbox Code Playgroud)
如果我没有调用createClient,一切都正常运行.我已经检查过AppKernel.php以确保FrameworkBundle(我相信这个服务定义的位置)肯定仍在那里,它确实存在.
我有点困惑,因为我之前已经设法做了这件事.
谢谢你的帮助.