{"enrichment":{"faq":[{"a":"Laravel-TDD teaches both PHPUnit and Pest frameworks for writing tests in Laravel. PHPUnit is the default testing framework included with Laravel, while Pest offers a more elegant, expressive syntax built on top of PHPUnit. Laravel-TDD covers writing unit tests for models and business logic, feature tests for HTTP requests and controllers, and JSON API tests. You'll learn the red-green-refactor cycle: write a failing test, implement code to pass it, then refactor. Both frameworks integrate seamlessly with Laravel's testing utilities like factories, faking, and assertion helpers.","q":"How to write tests in laravel using PHPUnit and Pest?"},{"a":"Laravel-TDD provides comprehensive guidance on testing Eloquent models, including model factory examples to generate test data efficiently. You'll learn how to test model relationships, scopes, mutators, and custom methods. The skill covers setting up database testing with factories, using seeders for test data, and writing assertions that validate model behavior. Laravel-TDD emphasizes isolating model logic in unit tests before testing them through feature tests that exercise the full application stack.","q":"What does Laravel-TDD cover for testing Eloquent models?"},{"a":"Laravel-TDD guides you through writing feature tests for controllers and HTTP endpoints using Laravel's testing utilities. You'll learn to test controller actions, validate HTTP responses, and verify JSON API responses. The skill covers testing form validation, checking status codes, inspecting response data, and following redirects. For APIs specifically, Laravel-TDD teaches JSON API testing patterns, including testing Sanctum authentication, verifying authorization policies, and mocking external service calls within API tests.","q":"How does Laravel-TDD approach testing Laravel controllers and APIs?"},{"a":"Laravel-TDD covers testing Sanctum authentication and API authorization comprehensively. You'll learn to create authenticated test requests using Sanctum tokens, verify that protected endpoints reject unauthenticated requests, and test token expiration and revocation. The skill includes testing authorization policies to ensure users can only access resources they're permitted to use. Laravel-TDD demonstrates mocking authenticated users, testing role-based access control, and validating API responses for both successful and unauthorized scenarios.","q":"How can I test Sanctum API authentication in Laravel?"},{"a":"Laravel-TDD covers mocking external services to isolate your tests and avoid real API calls during testing. You'll learn to use Laravel's faking utilities for common services like mail, queues, and HTTP requests. The skill teaches how to mock third-party APIs, verify that your code makes correct calls to external services, and test error handling when external services fail. Laravel-TDD emphasizes using factories and fakes to create predictable test environments, ensuring tests run fast and reliably without external dependencies.","q":"What techniques does Laravel-TDD teach for mocking external services?"},{"a":"Laravel-TDD guides you through measuring test effectiveness and achieving code coverage goals. You'll learn to run coverage reports using PHPUnit, identify untested code paths, and write tests strategically to reach coverage targets. The skill emphasizes that high coverage alone doesn't guarantee quality\u2014Laravel-TDD teaches writing meaningful tests that validate behavior, not just line coverage. You'll learn to balance unit and feature tests, prioritize critical paths, and use coverage metrics to guide your test-driven development workflow.","q":"How does Laravel-TDD help achieve code coverage targets?"}],"shadow_tags":["test-automation","code-quality","api-validation","mock-services","database-seeding","auth-testing","coverage-metrics","integration-tests","behavior-driven"],"summary_rewrite":"Laravel-TDD guides you through test-driven development for Laravel applications, covering PHPUnit and Pest frameworks alongside model factories, HTTP controller testing, and Sanctum authentication verification. Learn the red-green-refactor cycle with practical examples for unit tests, feature tests, and JSON API testing, plus techniques for mocking external services and validating authorization."},"files":[{"bytes":17769,"path":"skills/laravel-tdd/SKILL.md","sha256":"ceabcc7f27bbc3aea7cf496211b265fb0bb505698c6aabd2ca2c25b460b91cf4","url":"https://skillfed.io/files/affaan-m/ECC/laravel-tdd/367ef3db/SKILL.md"}],"id":"affaan-m/ECC/laravel-tdd","links":{"html":"https://skillfed.io/affaan-m/ECC/laravel-tdd","md":"https://skillfed.io/affaan-m/ECC/laravel-tdd.md","repo":"https://github.com/affaan-m/ECC"},"meta":{"agents_supported":[],"first_seen":"2026-07-28","forks":35692,"language":"JavaScript","last_updated":"2026-07-27","license":"MIT","name":"laravel-tdd","publisher":"affaan-m","stars":234207},"relations":{"similar":[{"id":"AsyrafHussin/agent-skills/laravel-testing"},{"id":"personamanagmentlayer/pcl/php-expert"},{"id":"iSerter/laravel-claude-agents/laravel-tdd"},{"id":"Jeffallan/claude-skills/laravel-specialist"},{"id":"iSerter/laravel-claude-agents/laravel-authorization-patterns"},{"id":"iSerter/laravel-claude-agents/laravel-feature-flags"},{"id":"iSerter/laravel-claude-agents/laravel-notification-patterns"},{"id":"iSerter/laravel-claude-agents/laravel-systematic-debugging"},{"id":"mwguerra/claude-code-plugins/testing"},{"id":"bobmatnyc/claude-mpm-skills/wordpress-testing-qa"}]},"slug":{"owner":"affaan-m","repo":"ECC","skill":"laravel-tdd"},"version":"367ef3db"}
