Okay,
So I got my Selenium PHPUnit integration working great, and that’s something I can even integrate into a build process.
Super easy, cause I don’t have to do anything but scan the DOM for whats expected.
See, the difficulty of doing it the PHPUnit / CI way is that you loose either the tight integration with CI or with the build tool.
If I used Unit_Test, a library in the CI framework, I could verify the code is functional, but its not really a test suite designed for build time. At least I haven’t seen an example yet. Yes, lots of questions indeed. Like this great question about how would someone go about implementing the CI Unit_Test class in a best practice way:
http://codeigniter.com/forums/viewthread/172956/
That doesn’t seem like it integrates with a build process very easily.
And the problem with PHPUnit is that we can only test core logic, or libraries, and not really the controllers. Its great for controllers that return values, like json objects. But what about methods that wire in the view and layout and actually render the page. I don’t yet know h0w to test those. I think I saw a library for PHPUnit that will do the job, CIUnit. But I am not sure, even, how you would wire all that together. There are a lot of CIUnit forks out there on bitbucket, but it doesn’t seem like a very mature project, still, seems chaotic.
And then another question is, is it how much testing is really necessary? 100% code coverage? I mean, isn’t functional testing with selenium enough?
Maybe just a few core tests with PHPUnit also, for whatever you can share from the CI project.