在 Symfony2 的测试环境中禁用安全防火墙 [英] Disable security firewall in test environment on Symfony2
本文介绍了在 Symfony2 的测试环境中禁用安全防火墙的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试为 Symfony2 中的测试环境禁用安全防火墙,但我不走运.这是我在 config_test.yml 中的内容:
I'm trying to disable a security firewall for a test environment in Symfony2, but i'm not having luck. Here's what i have in config_test.yml:
security:
firewalls:
web:
pattern: .*
security: false
anonymous: ~
然而,这并没有禁用安全性.任何想法如何在测试环境中完全禁用某个防火墙的安全性?
However, this is not disabling security. Any ideas how i can completely disable security for a certain firewall when in test env?
推荐答案
正如在类似主题中提到的 在开发时关闭防火墙 在您的 security.yml 中输入以下规则:
As mentioned in similar topic turn off firewall when developing put following rule in Your security.yml:
firewalls:
dev:
pattern: ^/
security: false
这篇关于在 Symfony2 的测试环境中禁用安全防火墙的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文