Testing patterns with Pest: Arrange-Act-Assert, proper mocking, null drivers, declarative factories.
Works with
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versionlaravel-testingExecute the skills CLI command in your project's root directory to begin installation:
Fetches laravel-testing from leeovery/claude-laravel and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate laravel-testing. Access via /laravel-testing in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
1
total installs
1
this week
43
GitHub stars
0
upvotes
Run in your terminal
1
installs
1
this week
43
stars
Testing patterns with Pest: Arrange-Act-Assert, proper mocking, null drivers, declarative factories.
Related guides:
Testing should be:
Every test should follow the Arrange-Act-Assert pattern:
Set up all the data and dependencies needed using factories:
it('creates an order with items', function () {
// Arrange: Create the world state
$user = User::factory()->create();
$product = Product::factory()->active()->create(['price' => 1000]);
$data = CreateOrderData::from([
'customer_email' => '[email protected]',
'items' => [
['product_id' => $product->id, 'quantity' => 2],
],
]);
// Act: Perform the operation
$order = resolve(CreateOrderAction::class)($user, $data);
// Assert: Verify the results
expect($order)
->toBeInstanceOf(Order::class)
->and($order->items)->toHaveCount(1)
->and($order->total)->toBe(2000);
});
Perform the single operation you're testing:
// ✅ Good - Single, clear action
$order = resolve(CreateOrderAction::class)($user, $data);
// ❌ Bad - Multiple actions mixed with assertions
$order = resolve(CreateOrderAction::class)($user, $data);
expect($order)->toBeInstanceOf(Order::class);
$order->refresh();
expect($order->total)->toBe(2000);
Verify the outcomes of your action:
// ✅ Good - Clear, focused assertions
expect($order)
->toBeInstanceOf(Order::class)
->and($order->status)->toBe(OrderStatus::Pending)
->and($order->items)->toHaveCount(2);
assertDatabaseHas('orders', [
'id' => $order->id,
'user_id' => $user->id,
]);
// ❌ Bad - Testing implementation details
expect($order->getAttribute('status'))->toBe('pending');
Actions are the heart of your domain logic and should be thoroughly tested in isolation.
use App\Actions\Order\CreateOrderAction;
use App\Data\CreateOrderData;
use App\Enums\OrderStatus;
use App\Models\User;
use function Pest\Laravel\assertDatabaseHas;
it('creates an order', function () {
// Arrange
$user = User::factory()->create();
$data = CreateOrderData::testFactory()->make([
'status' => OrderStatus::Pending,
]);
// Act
$order = resolve(CreateOrderAction::class)($user, $data);
// Assert
expect($order)->toBeInstanceOf(Order::class);
assertDatabaseHas('orders', [
'id' => $order->id,
'user_id' => $user->id,
'status' => OrderStatus::Pending->value,
]);
});
it('throws exception when user has too many pending orders', function () {
// Arrange
$user = User::factory()
->has(Order::factory()->pending()->count(5))
->create();
$data =Prerequisites
Time Estimate
15-45 minutes depending on use case complexity
Steps
Common Pitfalls
✓ Do
✗ Don't
💡 Pro Tips
✓ Use when
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid when
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
github/awesome-copilot
aj-geddes/useful-ai-prompts
refoundai/lenny-skills
skillcreatorai/ai-agent-skills
sickn33/antigravity-awesome-skills
sickn33/antigravity-awesome-skills
Registry listing for laravel-testing matched our evaluation — installs cleanly and behaves as described in the markdown.
Solid pick for teams standardizing on skills: laravel-testing is focused, and the summary matches what you get after install.
Useful defaults in laravel-testing — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
We added laravel-testing from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
laravel-testing is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
I recommend laravel-testing for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
laravel-testing fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
Keeps context tight: laravel-testing is the kind of skill you can hand to a new teammate without a long onboarding doc.
Registry listing for laravel-testing matched our evaluation — installs cleanly and behaves as described in the markdown.
Solid pick for teams standardizing on skills: laravel-testing is focused, and the summary matches what you get after install.
showing 1-10 of 25