petrvs-pest-testing

Write Pest tests for Petrvs-PGD across unit, central, and tenant integration scenarios.

19|14|Updated Aug 6, 2024
One-click install
npx skills add https://github.com/gestaogovbr/pgd-petrvs-publico --skill petrvs-pest-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: petrvs-pest-testing
Source: https://github.com/gestaogovbr/pgd-petrvs-publico/tree/main/.agents/skills/petrvs-pest-testing
Command: npx skills add https://github.com/gestaogovbr/pgd-petrvs-publico --skill petrvs-pest-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you create trustworthy backend test suites for Petrvs-PGD by guiding how to structure Pest tests across pure unit, central database integration, and tenant-aware integration.

Core Features & Use Cases

  • Test classification: Decide whether the behavior is pure logic, central DB, or tenant DB and choose the right test folder accordingly.
  • Fast, isolated Unit tests: Keep Unit tests free of real database schema changes and persistence by mocking repositories/services/facades.
  • Tenant-aware integration testing: Use the correct tenant test base and verify tenant database schema expectations for IntegrationTenant migrations.

Quick Start

Use the skill to help you plan and write a Pest test that targets a small unit of domain logic without touching the database, then expand it into an IntegrationTenant test when tenant rules and repositories must be verified.

Frequently Asked Questions about petrvs-pest-testing

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

FAQPage Schema
How do I structure Pest tests for backend logic versus database integration in PHP?

Pest tests for backend logic should be separated by intent: pure unit tests stay isolated with mocked dependencies, while database integration tests use specific test case bases to verify central or tenant schema behaviors.

When do I need tenant-aware integration testing in Pest?

Tenant-aware integration testing is needed when verifying tenant database schemas and repository rules. You use a specific tenant test base to ensure migrations and data behaviors apply correctly within isolated tenant boundaries.

How do I keep Pest unit tests fast and isolated from the database?

Keep Pest unit tests fast by mocking repositories, services, and facades instead of triggering real database schema changes or persistence. This ensures logic-only code paths execute without database overhead.

Does this Pest testing approach work with multi-tenant PHP applications?

Yes, this approach supports multi-tenant PHP applications by classifying test intent and applying the correct tenant test base. It verifies IntegrationTenant migrations and tenant-specific database schema expectations accurately.

What is the best way to migrate a unit test to a tenant integration test in Pest?

Start by writing a focused Pest test for a small unit of domain logic without touching the database. Expand it into an IntegrationTenant test when you need to verify tenant rules and repositories interacting with the database.