スキル一覧に戻る
alexborgognoni

test-feature

by alexborgognoni

RentPath is a rental property management platform built for European landlords, property managers, and tenants.

0🍴 0📅 2026年1月23日
GitHubで見るManusで実行

SKILL.md


name: test-feature description: Write Pest PHP feature tests following RentPath conventions. Use for writing new tests, understanding test patterns, using factories, and ensuring proper coverage. Auto-triggers on "write test", "add test", "test this feature", "create test", "test coverage".

Feature Test Writing Guide

You are helping write Pest PHP tests following RentPath conventions.

Arguments

This skill accepts optional arguments to specify what to test:

UsageBehavior
/test-featureInteractive - ask what to test
/test-feature ApplicationControllerWrite tests for that controller
/test-feature application submissionWrite tests for that workflow
/test-feature Application modelWrite tests for model logic
/test-feature the changes we just madeTest recent implementation
/test-feature authorizationFocus on auth/policy tests
/test-feature validationFocus on validation tests
/test-feature edge casesFocus on edge cases for current feature

Argument interpretation:

  • Controller/Model name - Write tests for that class
  • Workflow description - Write tests covering that flow
  • Focus area (authorization, validation, edge cases) - Specific test type
  • Context reference (the changes, what we did) - Test recent work

Before You Start

  1. Check existing tests: Look at tests/Feature/ for patterns
  2. Check factories: Review database/factories/ for available states
  3. Understand the feature: What behavior are you testing?

Tools to Use

TaskToolCommand/Action
Create testBashphp artisan make:test [Name]Test
View factoriesReaddatabase/factories/[Model]Factory.php
Run testsBashphp artisan test --filter=[pattern]
Run specific fileBashphp artisan test tests/Feature/[File].php
Check coverageBashphp artisan test --coverage

Quick Start

Basic Test Structure

<?php

use App\Models\User;
use App\Models\Property;
use Illuminate\Foundation\Testing\RefreshDatabase;

uses(RefreshDatabase::class);

beforeEach(function () {
    $this->user = User::factory()->create();
});

test('user can view property list', function () {
    Property::factory()->count(3)->create();

    $response = $this->actingAs($this->user)
        ->get('/properties');

    $response->assertOk();
    $response->assertInertia(fn ($page) => $page
        ->component('properties/index')
        ->has('properties', 3)
    );
});

Test Coverage Checklist

For CRUD Operations

[ ] Index - list items with pagination
[ ] Index - filter/search works
[ ] Create - form renders
[ ] Create - validation errors
[ ] Create - success creates record
[ ] Show - displays correct item
[ ] Show - 404 for non-existent
[ ] Update - form renders with data
[ ] Update - validation errors
[ ] Update - success updates record
[ ] Delete - removes record
[ ] Delete - handles dependencies

For Workflows

[ ] Each status transition
[ ] Invalid transitions rejected
[ ] Authorization at each step
[ ] Side effects triggered (events, notifications)

For Wizards

[ ] Each step renders
[ ] Step validation works
[ ] Can navigate between valid steps
[ ] Cannot skip ahead
[ ] Draft saves work
[ ] Final submission works

Running Tests

# All tests
php artisan test

# Specific file
php artisan test tests/Feature/ApplicationFlowTest.php

# Filter by name
php artisan test --filter="can submit application"

# Filter by describe block
php artisan test --filter="Application Submission"

# With coverage
php artisan test --coverage

# Parallel execution
php artisan test --parallel

# Stop on first failure
php artisan test --stop-on-failure

Detailed Guides

For comprehensive patterns and examples, see the supporting files:

Documentation References

  • tests/Pest.php - Global test configuration
  • database/factories/ - All model factories
  • .claude/agents/testing-expert.md - Testing expert agent
  • docs/patterns/wizard.md - Wizard testing patterns

Debugging Tips

// Dump response content
$response->dump();
$response->dumpHeaders();
$response->dumpSession();

// Disable exception handling to see full errors
$this->withoutExceptionHandling();

// Debug database state
dd(Application::all()->toArray());

// Check what was validated
dd($response->exception->validator->errors()->toArray());

スコア

総合スコア

65/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

レビュー

💬

レビュー機能は近日公開予定です