Download the PHP package grazulex/laravel-tddraft without Composer
On this page you can find all versions of the php package grazulex/laravel-tddraft. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download grazulex/laravel-tddraft
More information about grazulex/laravel-tddraft
Files in grazulex/laravel-tddraft
Package laravel-tddraft
Short Description A powerful Laravel package that provides LaravelTddraft functionality with modern PHP 8.3+ features.
License MIT
Homepage https://github.com/grazulex/laravel-tddraft
Informations about the package laravel-tddraft
Laravel TDDraft
Set up Test-Driven Development environments in Laravel using Pest 3 with dedicated draft testing directories.
[](https://packagist.org/packages/grazulex/laravel-tddraft) [](https://packagist.org/packages/grazulex/laravel-tddraft) [](LICENSE.md) [](https://php.net) [](https://laravel.com) [](https://pestphp.com) [](https://github.com/laravel/pint)Overview
Laravel TDDraft helps you practice Test-Driven Development by providing a structured approach to draft testing in Laravel applications. It creates a separate testing environment for experimental tests that won't interfere with your main test suite or CI pipeline.
TDDraft โ CI Workflow
Visual representation of the TDDraft workflow and promotion to CI test suite
The package enables a clean separation between experimental draft tests and production-ready CI tests, allowing you to practice TDD without affecting your deployment pipeline.
โจ Features
- ๐ง Five-command TDD workflow: The core innovation that enables true Test-Driven Development without CI interference
- ๐ Creates dedicated
tests/TDDraft/
directory for draft tests - โ๏ธ Automatically configures PHPUnit and Pest to exclude drafts from main test runs
- ๐งช Native Pest 3 support with proper test isolation
- ๐ Automatic backup of configuration files before modification
- ๐ Unique reference tracking for test promotion from draft to CI
- ๐ NEW: Comprehensive Test Status Tracking
- ๐ Automatic tracking of test execution results and history
- ๐ฏ Status persistence across test runs with
.status.json
- ๐ Historical tracking of test state changes
- ๐ Advanced test filtering and management by status
- ๐ Timestamped audit trails for test evolution
- โ๏ธ Configurable history limits and environment-specific settings
- ๐ฏ Built for clean TDD workflow separation
- ๐ Easy graduation path from draft tests to production test suite
- ๐ง Professional Test Management: Advanced filtering, promotion, and audit capabilities
๐ง The Five-Command TDD Workflow
Laravel TDDraft is built around a five-command workflow that enables true Test-Driven Development. This structured approach is the key to the project - it provides a complete TDD cycle from experimentation to production.
๐ The Complete TDD Flow
The five commands work together in a specific sequence that mirrors the TDD Red-Green-Refactor cycle:
๐ Command Reference
Command | Role in TDD Flow | Description |
---|---|---|
tdd:init |
๐๏ธ Setup | Initialize TDDraft environment and configuration with status tracking |
tdd:make |
๐งช Red Phase | Create a new failing test with unique tracking reference |
tdd:test |
๐ Red-Green Cycle | Run and iterate on draft tests with automatic status tracking |
tdd:list |
๐ Review | List and manage draft tests with status history and filtering |
tdd:promote |
๐ Graduate | Move ready tests to production CI suite with audit trail |
๐ฏ Why This Flow Matters
This five-command sequence is the core innovation of Laravel TDDraft. It solves the common TDD problems:
tdd:init
- Creates a separate space for experimental teststdd:make
- Enables rapid test creation without affecting CItdd:test
- Allows focused iteration on draft tests onlytdd:list
- Provides oversight of your TDD pipelinetdd:promote
- Ensures only ready tests reach production
๐ Complete Workflow Example
This workflow keeps your CI clean while enabling true TDD experimentation. Your main test suite never sees failing or experimental tests, but you can still practice proper Red-Green-Refactor cycles.
๐ Quick Start
1. Install the Package
2. Install Pest (Required)
๐ก Laravel TDDraft requires Pest v3.8 or higher:
3. Publish Configuration
4. Initialize TDDraft
This command will:
- Create
tests/TDDraft/
directory structure with.gitkeep
- Configure PHPUnit to separate TDDraft tests from main suite
- Configure Pest to exclude TDDraft from default test runs
- Set up status tracking system for test execution monitoring
- Create configuration file with environment-specific status tracking settings
- Optionally create example test files for quick start
๐ Usage
Create Draft Tests
Create new TDDraft tests with unique tracking:
Write Draft Tests
The generated test files include unique references and proper grouping:
Run Tests with Status Tracking
Laravel TDDraft provides dedicated commands with automatic status monitoring:
Comprehensive Status Tracking System
Laravel TDDraft now automatically tracks your test execution results:
Comprehensive status tracking features:
- โ Automatic Recording: Test results (passed/failed/error/skipped) saved after each run
- ๐ Historical Tracking: Maintains change history for test evolution analysis
- ๐ Reference-Based Linking: Status tied to unique test references for audit trails
- ๐ JSON Storage: Structured data for easy integration with external tools
- โ๏ธ Environment Configuration: Customizable tracking behavior per environment
- ๐ Test Stability Analysis: Track which tests are ready for promotion based on status history
Example status file structure:
List and Manage Tests
Use the tdd:list
command to view and manage your draft tests:
Example output:
Graduate Tests
When your draft test is ready for production, you have two options for promoting it to your main test suite:
Option 1: Automated Promotion (Recommended)
Use the tdd:promote
command with the unique reference for automated promotion:
Option 2: Manual Promotion
For manual control, you can still promote tests manually:
Status Tracking and Test Lineage
The unique reference system with status tracking allows you to:
- Track Test Evolution: Monitor tests from draft to production with complete history
- Analyze Test Stability: Use status history to determine promotion readiness
- Maintain Audit Trails: Full traceability for compliance and debugging
- Link CI Failures: Connect production failures back to original draft intent
- Data-Driven Decisions: Use status data to optimize TDD workflow
Advanced status analysis example:
โ๏ธ Configuration
Status Tracking Configuration
The package configuration is published to config/tddraft.php
with comprehensive status tracking options:
Environment-Specific Configuration
Configure different behavior per environment:
๐งช Example Draft Test
Example of a TDDraft test with unique reference tracking and status monitoring:
Key features demonstrated:
- โ
Unique Reference:
tdd-20250718142530-Abc123
for tracking and promotion - ๐ Status Tracking: Each run records pass/fail status with timestamp
- ๐ TDD Cycle: Start with failing test, implement code, achieve passing status
- ๐ฏ Promotion Ready: Use status history to determine when test is stable
๐ Documentation & Examples
Complete Documentation
For comprehensive documentation, see the docs/
directory:
- Installation Guide - Step-by-step setup instructions
- Configuration - Detailed configuration options
- Usage Guide - Complete usage patterns and workflows
- Commands Reference - All five commands with examples
- Best Practices - Professional TDD patterns
- Troubleshooting - Common issues and solutions
Practical Examples
The examples/
directory contains comprehensive usage examples:
- Basic Usage - Complete five-command workflow with status tracking
- Advanced Usage - Enterprise patterns, CI integration, and status analysis
- Examples README - Real-world usage patterns and organization strategies
Examples demonstrate:
- โ Five-command TDD workflow from init to promote
- ๐ Status tracking integration and analysis
- ๐๏ธ Test organization strategies for complex projects
- ๐ Automated promotion workflows
- ๐ Performance monitoring and audit trails
- ๐ง CI/CD integration patterns
๐ง Requirements
- PHP 8.3+
- Laravel 12.19+
- Pest 3.8+
๐ค Contributing
Please see CONTRIBUTING.md for details on how to contribute to this project.
๐ License
This package is open-source software licensed under the MIT license.
All versions of laravel-tddraft with dependencies
illuminate/support Version ^12.19
nesbot/carbon Version ^3.10
illuminate/contracts Version ^12.0