{"enrichment":{"faq":[{"a":"Pest replaces PHPUnit class-based tests with function-style closures. Use test() or it() to define a test, then chain expect() with your assertion: test('adds numbers', function() { expect(1 + 1)->toBe(2); }). The expect() API provides fluent methods like toBe(), toEqual(), toContain(), and hundreds more, all chainable for readable assertions. Closures receive automatic dependency injection and access to $this for helper methods.","q":"How do I write pest tests using closures and the expect API?"},{"a":"Pest datasets enable parameterized testing without repeating test code. Use dataset() to define test cases, then reference them with ->with('datasetName'). Example: dataset('numbers', [1, 2, 3]) paired with test('is positive', fn($n) => expect($n)->toBeGreaterThan(0))->with('numbers'). Datasets replace PHPUnit's @dataProvider annotation and support inline arrays, external files, or database queries for flexible test data organization.","q":"What are Pest datasets and how do data providers work?"},{"a":"Pest hooks manage setup and teardown logic. Use beforeEach() to run code before each test\u2014ideal for resetting state or creating fixtures. Use afterEach() for cleanup. Hooks can be scoped with describe() blocks: describe('auth', function() { beforeEach(fn() => login()); it('...'); }) ensures login runs only for tests in that block. Global hooks run for all tests; nested hooks inherit and stack.","q":"How do Pest hooks like beforeEach and afterEach work?"},{"a":"Pest architecture testing enforces code structure rules without assertions. Use arch()->preset()->laravel() or custom rules like ->classes('App\\Models')->shouldExtend(Model). Mutation testing verifies test quality by introducing code changes (mutations) and checking if tests catch them. Run pest --mutate to detect weak tests. Both features ensure code maintainability and test reliability beyond simple coverage metrics.","q":"What is Pest architecture testing and mutation testing?"},{"a":"Pest CLI offers powerful execution control. Use --filter to run specific tests by name, --group to organize by tags, --coverage for code coverage reports, and --parallel to run tests concurrently. Example: pest --filter auth --coverage --parallel. Configure parallelization in pest.php with processes option. Combine flags for flexible test runs: pest --only, --skip, --profile for profiling slow tests.","q":"How do I run Pest CLI with filtering, coverage, and parallelization?"},{"a":"Pest provides a migration path from PHPUnit. Replace class methods with test() closures: PHPUnit's public function testExample() becomes test('example', function() { ... }). Convert $this->assert*() calls to expect() chains. Use pest --convert to automatically transform existing PHPUnit tests. Hooks replace setUp/tearDown methods. Datasets replace @dataProvider. Most PHPUnit features map directly; Pest's syntax is more concise and readable.","q":"How do I migrate from PHPUnit class-based tests to Pest?"}],"shadow_tags":["function-based-testing","fluent-assertions","php-testing-framework","behavioral-test-syntax","test-data-providers","structural-code-validation","browser-automation-testing","mutation-score-analysis","test-filtering-focus","phpunit-abstraction"],"summary_rewrite":"Pest is a testing framework built on PHPUnit that replaces test classes with closures and assertion methods with a fluent expect() API. This skill covers test structure using test()/it()/describe(), the full expect() chain including modifiers and custom expectations, hooks for setup and teardown, datasets for parameterized testing, and advanced features like architecture rules and mutation testing."},"files":[{"bytes":14050,"path":"plugins/php/skills/pest/SKILL.md","sha256":"bc874b828ff1935c7e27b9f738e0b7655935284b2cb33bcd6b36e46eedb18284","url":"https://skillfed.io/files/xobotyi/cc-foundry/pest/86627a61/SKILL.md"}],"id":"xobotyi/cc-foundry/pest","links":{"html":"https://skillfed.io/xobotyi/cc-foundry/pest","md":"https://skillfed.io/xobotyi/cc-foundry/pest.md","repo":"https://github.com/xobotyi/cc-foundry"},"meta":{"agents_supported":[],"first_seen":"2026-07-28","forks":0,"language":"JavaScript","last_updated":"2026-07-10","license":"MIT","name":"pest","publisher":"xobotyi","stars":18},"relations":{"similar":[{"id":"AsyrafHussin/agent-skills/laravel-testing"},{"id":"bagisto/agent-skills/pest-testing"},{"id":"affaan-m/ECC/laravel-tdd"},{"id":"mwguerra/claude-code-plugins/testing"},{"id":"LambdaTest/agent-skills/phpunit-skill"},{"id":"softspark/ai-toolkit/php-rules"},{"id":"Jeffallan/claude-skills/php-pro"},{"id":"xobotyi/cc-foundry/phpunit"},{"id":"irahardianto/awesome-agv/php-idioms"},{"id":"TheBeardedBearSAS/claude-craft/testing-symfony"}]},"slug":{"owner":"xobotyi","repo":"cc-foundry","skill":"pest"},"version":"86627a61"}
