Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mjlovefl's avatar

Testing Nova Custom Tools

I've been looking through some other Nova custom tools on GitHub, and for the ones I've gone through, I've noticed none of them included any tests.

It seems odd to me, as I like developing using TDD.

I'm wondering if the best way to test would be to simply create a new abstract TestCase class that extends Illuminate\Foundation\Testing\TestCase inside of my components tests/ directory.

Is anyone writing tests for their Nova Custom Tools?

0 likes
1 reply
Reppair's avatar

Doesn't seem that way unfortunately.

I am currently trying to write a basic test for authorizing access to a custom tool and I can't find pretty much anything on testing Nova stuff..

I've found this package https://joshgaber.github.io/NovaUnit , that however has nothing on testing authorization nor custom tools.

For resources and dashboards I've been asserting that I get a 403 on hitting routes, then granting the test user permissions and asserting 200 status. However Tools behave differently, when canSee() method returns false, I get a 404 error page with status 200 instead a 404 or 403... which breaks my process

Please or to participate in this conversation.