Testing
What the framework already tests
tests/Feature/PluginSystemTest.phpruns the whole lifecycle against a disposable fixture plugin that is written tocore/pluginsat runtime: discovery, enable, hooks, menus and assets, permission-gated menu visibility, disable, uninstall, and rejection of invalid manifests.tests/Feature/AdminPluginCatalogTest.phpcovers the admin screen: both channels listed, the four JSON actions, permission checks and the uninstall confirmation.- The fixture factory is shared as
tests/Support/CreatesPluginFixture, so you can reuse it in your own tests.
Run them with:
DB_DATABASE=helpnest_ai_test php artisan test --filter=PluginSystemTest
Testing your own plugin
Write a normal Laravel feature test. Enable your plugin first, then call its routes as a signed-in customer:
public function test_customer_only_sees_their_own_notes(): void
{
// enable the plugin, create two customers, add a note for each
$this->actingAs($customerA)
->get(route('plugin.notes.user.index'))
->assertOk()
->assertSee('A note')
->assertDontSee('B note');
}
Worth covering in every plugin:
- Tenant isolation: customer A can never read, change or delete customer B's data (this is the most common plugin bug).
- Validation: bad input is rejected with a helpful message.
- Failure isolation: if a third-party service is down, the visitor's request still succeeds.
- Lifecycle: enable, disable and uninstall leave the system clean.
Warning
Do not use migrate:fresh on the HelpNest repository to prepare a test database. It is currently broken by a missing migration. Prepare the helpnest_ai_test database by hand as described in the docblock of tests/Feature/AdminImpersonationTest.php.
Still stuck?
Our support team is ready to help you get set up.

