Do not change security.yml , instead create a special rule for testing.
You need to disable the entire security firewall configuration at config_test.yml :
imports: - { resource: config_dev.yml } framework: test: ~ session: storage_id: session.storage.mock_file profiler: collect: false web_profiler: toolbar: false intercept_redirects: false swiftmailer: disable_delivery: true security: firewalls: dev: pattern: ^/ security: false
Note
Remember that config_test.yml
imports config_dev.yml
, which imports config.yml
. Therefore, you must redefine the entire base configuration in the test configuration file for it to work.
source share