I'm starting working on unit tests for a Zend Framework 2 project using ZfcUser + BjyAuthorize.
I'm not a unit test expert, so I found how to mock ZfcUser here.
Now I also have to mock BjyAuthorize. Has anyone managed to do it before?
I'm starting working on unit tests for a Zend Framework 2 project using ZfcUser + BjyAuthorize.
I'm not a unit test expert, so I found how to mock ZfcUser here.
Now I also have to mock BjyAuthorize. Has anyone managed to do it before?
Well it is surely late to respond to this.
I've come to a solution using Mock object (well I don't like using mock...), I could not find a way to initialize properly BjyAuthorize...
Well my test controller extends from AbstractHttpControllerTestCase
in testController::setUp() I made the mock object like that :
I don't like this solution though, I find it really ugly but I can't find out an other way to do it.