api-test-gen

Generates PHPUnit ApiTestCase files for endpoints with authorization, validation, and boundary coverage.

2|Updated Mar 19, 2026
One-click install
npx skills add https://github.com/EvanPluchart/kyomu --skill api-test-gen-evanpluchart
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-test-gen
Source: https://github.com/EvanPluchart/kyomu/tree/main/.claude/skills/api-test-gen
Command: npx skills add https://github.com/EvanPluchart/kyomu --skill api-test-gen-evanpluchart

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It eliminates the manual, repetitive effort of writing comprehensive API tests by generating coverage for common behaviors like successful responses, authorization rules, validation errors, and edge cases.

Core Features & Use Cases

  • Endpoint scanning: Detects API Platform routes or Express-like endpoints by reading API metadata and available routes.
  • Test generation by scope: Supports generating tests for a specific endpoint, an entity, a full domain, or by analyzing existing coverage to propose missing tests.
  • Authorization, validation, and limits: Produces nominal tests plus tests for forbidden/unauthenticated access, invalid payloads, missing fields, and non-existent or empty-resource scenarios.
  • Framework-aligned output: Targets PHPUnit-style ApiTestCase (Symfony) and follows repository test conventions with helpers and fixtures.

Quick Start

Ask api-test-gen to generate PHPUnit ApiTestCase coverage for the domain you specify using the existing API routes and conventions in your project.

Frequently Asked Questions about api-test-gen

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate PHPUnit API tests for existing Symfony endpoints?

Generate PHPUnit API tests by scanning existing API Platform or Express-like route metadata to automatically produce ApiTestCase files covering nominal behavior, authorization, validation, and boundary cases. The tool creates one test file per entity and includes necessary fixtures.

What is the best way to automate coverage for API validation and authorization tests?

Automate API test coverage by generating tests that specifically target validation errors, forbidden access, unauthenticated requests, and invalid payloads. It scans route metadata to produce framework-aligned tests following Symfony PHPUnit ApiTestCase patterns and repository conventions.

Can I analyze existing API test coverage to find missing endpoint tests?

Yes, you can analyze existing test coverage to identify and propose missing tests. The generation process supports analyzing coverage gaps for specific endpoints, entities, or entire domains, then generates the missing PHPUnit ApiTestCase files and fixtures.

Does api-test-gen work with API Platform and Symfony PHPUnit ApiTestCase patterns?

Yes, it works with API Platform and Symfony by detecting API Platform routes and generating PHPUnit-style ApiTestCase files. It follows existing repository test conventions, uses helpers, and creates fixtures so the generated tests can pass immediately.

How do I create fixtures for boundary case API tests?

Create fixtures for boundary case API tests automatically during the test generation process. It produces nominal tests alongside edge cases for non-existent resources, missing fields, and empty-resource scenarios, generating the fixtures required for these tests to pass.

What types of boundary cases are covered by automated API test generation?

Automated API test generation covers boundary cases including non-existent resources, empty-resource scenarios, missing fields, and invalid payloads. It also generates tests for unauthenticated access and forbidden authorization rules to ensure comprehensive endpoint validation.