Skip to content
Development
Skill

/api-platform-tests

Test API Platform resources with ApiTestCase; assert collections, items, filters, JSON schema, and authentication

From plugin
superpowers-symfony
22744 skills14 agents13 commands1 hook

Claude Code

$ npx -y skills add dev-toolings/superpowers-symfony --skill api-platform-tests --agent claude-code

SKILL.md

api-platform-tests.SKILL.md
name: api-platform-tests
description: Test API Platform resources with ApiTestCase; assert collections, items, filters, JSON schema, and authentication
capabilities: [read, search, edit, shell]
tags: [api-platform, testing]
# projected by `bun run build` — do not edit by hand
allowed-tools:
  - Read
  - Glob
  - Grep
  - Write
  - Edit
  - Bash

Api Platform Tests (Symfony)

Use when

  • Writing functional tests for API Platform endpoints: collection, item, create, update, delete.
  • Asserting validation errors (422) and access control (401, 403).
  • Checking filters, pagination, or the JSON schema of responses.
  • Setting up a clean database and test data for API tests.

Default workflow

1. Extend `ApiTestCase` and seed data with Foundry factories (`createOne`, `createMany`). 2. Reset state with `#[ResetDatabase]` and the `Factories` trait, with DAMA rolling back each test. 3. Call `static::createClient()->request()` and assert the status code, content type, and `assertJsonContains()`. 4. Authenticate with `auth_bearer` and cover the anonymous, owner, and other-user cases. 5. Assert `member` and `totalItems` for filters and pagination (`hydra:`-prefixed only with `hydra_prefix: true`). 6. Assert the shape with `assertMatchesResourceItemJsonSchema()` and `assertMatchesResourceCollectionJsonSchema()`.

Guardrails

  • Send `PATCH` with the `application/merge-patch+json` content type.
  • `#[ResetDatabase]` needs PHPUnit 10+ and Foundry 2.9: use the `ResetDatabase` trait on PHPUnit 9.
  • Cover the failure paths too: 404, 422, 401, 403. A type error on a constrained property is 422 in 5.0 but 400 in 4.4 and earlier.
  • Read the configured items per page rather than hardcoding a page size in assertions.

Progressive disclosure

  • Use this file for execution posture and risk controls.
  • Open references when deep implementation details are needed.

Output contract

  • The test classes added and the endpoints they cover.
  • Factories and reset strategy used.
  • Test run output, including the failure paths.

References

  • `reference.md`
Read more
@dev-toolings
Ships withsuperpowers-symfony

Superpowers Symfony gives coding agents deep, version-accurate Symfony expertise: from Doctrine schema design and API Platform REST/GraphQL APIs to test-driven development, async Messenger workflows, caching, rate limiting, and clean architecture.

22744 skills14 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
227
Star history of dev-toolings/superpowers-symfony on GitHub, a chart by star-history.com

Other skills on superpowers-symfony.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills11d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react2d252k
@facebook@facebookInstall Skill

Questions about api-platform-tests.

Which coding agents can use api-platform-tests?
api-platform-tests installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.