如何从 Symfony 2 中的功能测试加载装置 [英] How can I load fixtures from functional test in Symfony 2
问题描述
我的 DoctrineFixturesBundle 已安装,我可以通过命令行加载夹具,但是,如何从我的功能测试中加载夹具?
您可以在测试的 setUp()
方法中加载装置,正如您在 这个问题.>
您可以使用问题中的代码,但需要将--append
附加到doctrine:fixtures:load
命令中,以避免被fixtures确认-捆绑.
更好的解决方案是查看 LiipFunctionalTestBundle,它可以更轻松地使用数据夹具.
My DoctrineFixturesBundle is installed and I can load fixture trough the command-line but , how can I load fixtures from my functional test ?
You can load the fixtures in your test's setUp()
method as you can see in this question.
You can use the code in the question but need to append --append
to the doctrine:fixtures:load
command in order to avoid the confirmation by the fixtures-bundle.
The better solution is to have a look at the LiipFunctionalTestBundle which makes using data-fixtures easier.
这篇关于如何从 Symfony 2 中的功能测试加载装置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!