【发布时间】:2016-10-19 15:40:32
【问题描述】:
我开始探索 symfony3 并在安装后运行提供的功能测试通过
phpunit
在终端上,但我收到错误:
1) Tests\AppBundle\Controller\DefaultControllerTest::testIndex
Failed asserting that 500 matches expected 200.
通过浏览器点击页面是可行的。
需要更改哪些设置才能通过此测试?
【问题讨论】:
-
查看
var/log/test.log文件了解更多详情。 -
很酷的感谢现在是有道理的!
-
嗨@fefe你解决了吗?
-
是的,我之前添加了 FOSUserBundle 但未配置,这就是我在 test.log
request.CRITICAL: Uncaught PHP Exception Symfony\Component\Config\Exception\FileLoaderLoadException: "Bundle "FOSUserBundle" does not exist or it is not enabled.中得到的。感谢您的提示! -
关于措辞的旁注:即使您通过 phpunit 运行测试,它也不是单元测试而是功能测试,因为您通过 php 浏览器测试站点的功能,而不是方法的输出一定的输入。 You may want to read this answer
标签: phpunit symfony functional-testing