I wasted most of today trying to make phpunit tests work with the "controller" (it's not really a controller, it's a "command" object) in our work mvc.
First I had to mock the relevant classes so the methods I needed access to were public (yes, I know I'm not *supposed* to run tests against protected methods, but there are no public methods in this mvc!). That worked ok, but things started going bad when I tried to integrate the phpunit with our phpUnderControl continuous integration for testing - it got very confused with the include paths.
Things were already pretty messy at this stage, and it just got worse as I ran the controller test from the command line - more problems with include paths, problems with db connections...too many problems.
So I've given up. It works perfectly fine with the models, so I'm just going to happily, and easily, test them (and maybe push more functionality there).
0 Responses to The satisfaction in giving up
Leave a Reply