2

I want to test that my access_control is working as expected, that certain roles don't have access to a page while other roles do.

I can do this using Functional Tests, logging in each user and testing the response from the given page. I don't think this way is very maintainable and was wondering if anybody else had a better way?

I am using a combination of annotations and access_control configuration to prevent access to controllers.

Michael Berkowski
  • 267,341
  • 46
  • 444
  • 390
Logan Bailey
  • 7,039
  • 7
  • 36
  • 44
  • 3
    check this link http://symfony.com/doc/2.0/cookbook/testing/simulating_authentication.html also this answer seems to have gotten a lot of votes http://stackoverflow.com/a/8479353/2149092 – Mohammad AbuShady Jun 06 '13 at 23:05

0 Answers0