-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Covers PHPUnit Annotation to Controller Baked Classes #16
Comments
I'm on the fence about this without going the extra step and having explicit unit vs integration test suites for controllers. As much as I think there are problems with "defaulting" to integration tests, it's what Cake 3 expects, and despite appearances I don't really want to stray too far from that. In addition, the Another (possible) complication is that this gets really sticky when you get into prefixed/namespaced classes. Take a look at what we had to do in Eyesore because of the way we tested each namespaced method using a shared test case using each user role as a |
Yeah I just updated the comment to include that it would require the full namespaced path. |
The big thing this is that trying to get coverage in a project means I have to fight with the integration tests doing coverage because the coverage is lying to me. |
Yeah, that's a valid point. I thought I had opened a |
Regarding the changing method names, that makes sense for things like Tables, Components, etc but since Controller method names are (generally) the url being hit they rarely change at least what we've generally observed. Adding it only to the Controller might be a way of mitigating this need to change the annotation when updating a method name. |
More information: https://phpunit.de/manual/current/en/appendixes.annotations.html#appendixes.annotations.covers.tables.annotations
Note
@covers
requires the full namespaced path, like so@covers \App\Controller\Anon\CampSessionsController::index
The text was updated successfully, but these errors were encountered: