Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Writes Pest tests for framework-agnostic PHP packages using Francisco Barrento's testing and naming conventions, with fbarrento/data-factory as the default for data-object test data. Use when writing, editing, or reviewing Pest tests inside a standalone Composer package (no Laravel app, no Testbench, no Eloquent), or when scaffolding a factory for a data object / DTO / value object in such a package.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-14 | ✗→✓ | ▲ Improved | -33% | 0% |
| case-01 | ✗→✓ | ▲ Improved | -16% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 50% | 0% |
| case-03 | ✗→✓ | ▲ Improved | -25% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 59% | 0% |
Use this skill for standalone Composer packages that do not boot Laravel. There is no service container, no Laravel fakes, and no Eloquent. Resolve collaborators with new, build test data with fbarrento/data-factory for data objects, and roll in-memory doubles for service dependencies.
When testing inside a full Laravel application instead, prefer the laravel-rules skill.
phpuse FBarrento\DataFactory\Factory; use Vendor\Package\Actions\CreateWaitlistSignup; use Vendor\Package\Data\CreateWaitlistSignupData; beforeEach(function (): void { $this->createWaitlistSignup = new CreateWaitlistSignup(); }); test('creates a waitlist signup from data', /** * @throws Exception */ function (): void { $data = CreateWaitlistSignupData::factory()->make(); $waitlistSignup = $this->createWaitlistSignup->handle($data); expect($waitlistSignup->id)->toBeString() ->and($waitlistSignup->email)->toBe($data->email) ->and($waitlistSignup->createdAt)->not->toBeNull(); });
rules/testing.mdtest() for Pest tests, never it().->and() instead of separate expect() blocks.new in beforeEach() and assign them to $this.src/ structure in tests/Unit/.tests/Feature/ for cross-cutting or integration tests.tests/Utils/.resolve() — the package has no Laravel container.rules/naming.mdTest suffix and mirror the source class name.Action suffix.Query suffix; services use the Service suffix.Data suffix; value objects use a domain noun (no VO).$this properties for the value they contain.rules/architecture.mdsrc/ flat: Actions/, Queries/, Services/, Data/, ValueObjects/, Exceptions/.Data suffix) carry payloads; value objects enforce domain invariants.src/Exceptions/.rules/data-factory.mdfbarrento/data-factory as the default for data objects, DTOs, and value objects.tests/Factories/ and name them <Class>Factory.HasDataFactory trait to the class so tests call Class::factory().->succeeded(), ->expired()) instead of inline state([...]) overrides in tests.->make() for in-memory tests; reserve ->create() for cases that need persistence.See EXAMPLES.md for an end-to-end walkthrough: data object + factory + port + in-memory adapter + action + Pest test, all four rules applied together.
laravel-rules skill instead.tests/Factories/ first, then write the Pest test on top of it.Other measured skills in the registry, with their headline benchmark lift.