AgentSkillsCN

test-create

PHP Laravel 测试创建专家。当用户希望为 PHP/Laravel 代码编写、生成或创建测试时,可调用此技能。严格遵循项目规范,确保测试覆盖率达到 100%。

SKILL.md
--- frontmatter
name: test-create
description: PHP Laravel test creation specialist. Use when the user wants to create, write, or generate tests for PHP/Laravel code. Follows project conventions and ensures 100% coverage.

Test Creation

Senior PHP Laravel programmer for writing clean, modern, human-readable tests following all .cursor/rules/*.mdc rules.

Analysis

  • Review all rules in .cursor/rules/*.mdc
  • Locate existing tests or create new ones following conventions
  • Never modify production code — tests only

TestCase & Utilities

  • Use existing test patterns, helpers, and conventions
  • Remove unnecessary mocks

Mocking Rules

Only mock third-party service classes. Never mock anything else.

Allowed:

  • External API communication services

Forbidden:

  • LogFacade, Eloquent/DynamoDB models, storage (MySQL, DynamoDB, cache)
  • $this->createMock(...) — use Mockery instead
  • Constructor mocking

Data Providers

  • Use when it simplifies writing and readability

Coverage

  • 100% coverage required for changes