/syarif-laravel-ai-skills:testingfrom syarif-laravel-ai-skills
Guides Laravel test selection: feature tests for routes/controllers, unit tests for helpers, browser E2E for JS-dependent flows. Covers Laravel fakes, workflow tests, and render/document assertions.
Ships in syarif-laravel-ai-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Tests should prove behavior, not mirror implementation. Prefer the smallest test type that catches the risk.
Use feature tests for:
Use unit tests for:
Use browser E2E tests for:
Use ui-agent-browser while a frontend workflow is still being explored or implemented. Use e2e-playwright when that workflow should become repeatable Playwright coverage.
Use Laravel fakes for external or filesystem side effects.
Http::fake([
'api.example.test/*' => Http::response(['ok' => true]),
]);
$this->post(route('records.send', $record))
->assertRedirect()
->assertSessionHasNoErrors();
Http::assertSent(fn ($request) => $request->method() === 'POST');
Common fakes:
Http::fake();Storage::fake();Mail::fake();Notification::fake();Queue::fake() or Bus::fake();Event::fake().For important user-facing workflows, cover the full route behavior.
$this->actingAs($user)
->post(route('records.store'), [
'name' => 'Example',
])
->assertRedirect(route('records.index'))
->assertSessionHasNoErrors();
$this->assertDatabaseHas('records', [
'name' => 'Example',
]);
When rebuilding or porting an app, add feature parity tests for critical happy paths. Parity tests are a regression net, not a replacement for focused tests.
For pure Blade/report rendering, unsaved Eloquent graphs may be built with forceFill() and setRelation().
Use this only when persistence, middleware, authorization, route model binding, database constraints, queries, and events are not part of the behavior.
$owner = (new User)->forceFill(['name' => 'Example User']);
$record = (new Record)->forceFill(['number' => 'DOC-001']);
$record->setRelation('owner', $owner);
$html = view('reports.record', ['record' => $record])->render();
$this->assertStringContainsString('DOC-001', $html);
For generated documents, assert both stable source content and artifact validity.
$html = view('reports.record', $viewData)->render();
$output = Pdf::loadView('reports.record', $viewData)->output();
$this->assertStringContainsString('Document Number', $html);
$this->assertStringStartsWith('%PDF-', $output);
Avoid broad snapshots unless the project intentionally uses snapshot or visual-regression testing.
For Playwright or similar tools:
For Laravel Playwright details, load e2e-playwright instead of re-deriving setup, auth state, locator, trace, and screenshot rules.
Before work is complete, run the relevant checks:
If a check cannot run, report the command and reason.
Layer: 4 (Verification)
Load this skill only when writing or reviewing tests. Do not load with unrelated skills. Keep tests behavior-focused: smallest test type that catches the risk, no per-function suites unless asked, no frameworks/fixtures for trivial logic.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
laravel-testing, phpunit, feature-tests, unit-tests, e2e-tests
Other plugins' skills for the same job
72 skills in this plugin
/actions-and-servicesUse Actions and Services as deliberate Laravel application boundaries for use cases, integrations, and reusable workflows./ai-sdkBuild AI features with the first-party Laravel AI SDK (Laravel 13+); agents, embeddings, images, audio, and tool calling with provider-agnostic APIs/api-resources-and-paginationLaravel guidance to use API Resources with pagination and conditional fields; keep response shapes stable and cache-friendly/api-surface-evolutionLaravel guidance to evolve APIs safely using versioned DTOs/transformers, deprecations, and compatibility tests/architectureApply Laravel-native architecture decisions without forcing unnecessary repositories, interfaces, DTOs, or custom layers./blade-components-and-layoutsLaravel guidance to compose UIs with Blade components, slots, and layouts; keep templates pure and testableGenerated from the plugin's indexed repository (soden46/syarif-laravel-ai-skills) — no native marketplace selected
npx claudepluginhub p/soden46-syarif-laravel-ai-skills