Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Phpunit Select Config Laravel Package

automattic/phpunit-select-config

Small utility for PHPUnit projects that helps select or switch the PHPUnit configuration file to use when running tests. Handy for repos with multiple phpunit.xml variants (e.g., local vs CI) and scripts that need consistent config selection.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Multi-Version Test Automation: Enables seamless execution of PHPUnit tests across different PHPUnit versions (e.g., 8, 9, 10) without manual configuration switches, critical for Laravel projects supporting legacy and modern PHP stacks. Reduces CI/CD complexity by dynamically selecting test configurations based on PHPUnit version.
  • CI/CD Pipeline Optimization: Eliminates flakiness in CI by automating test configuration selection (e.g., phpunit.xml.ci for GitHub Actions, phpunit.xml.local for local dev). Aligns with DevOps goals for faster, more reliable builds by reducing manual intervention in scripts.
  • Feature-Flagged Testing: Supports conditional test execution (e.g., @group feature-x or version-specific configs) without modifying core test files. Enables safer rollouts of experimental features in Laravel applications by isolating tests to specific configurations.
  • Build vs. Buy: Avoids reinventing a custom solution for versioned test configurations, leveraging a lightweight, Automattic-backed package with minimal maintenance overhead. Ideal for teams prioritizing developer velocity over custom tooling.
  • Monorepo/Plugin Compatibility: Ideal for Laravel-based monorepos or plugin ecosystems (e.g., WordPress plugins, SaaS microservices) where test configurations differ by module or version. Simplifies testing in heterogeneous environments.
  • Legacy System Modernization: Facilitates gradual migration from older PHPUnit versions (e.g., 8) to newer ones (e.g., 10) by maintaining parallel test suites until full compatibility is achieved. Reduces risk during transitions.

When to Consider This Package

  • Adopt if:

    • Your project uses PHPUnit and requires dynamic test configuration selection (e.g., by PHPUnit version, environment, or feature flag).
    • You manage multiple test configurations (e.g., phpunit.xml, phpunit.xml.ci, phpunit.xml.feature-x) and want to automate their selection in CI/CD or local development.
    • Your team supports multiple Laravel/PHP versions (e.g., PHP 8.0–8.3) with corresponding PHPUnit versions, requiring version-specific test setups.
    • You’re using a monorepo or plugin architecture (e.g., Laravel + WordPress plugins) where test configurations vary by module or version.
    • You want to reduce CI/CD maintenance by eliminating manual configuration switches in scripts or pipelines.
    • Your Laravel project relies on versioned testing (e.g., testing Laravel 8 vs. Laravel 10 features in parallel).
  • Look elsewhere if:

    • Your test suite is homogeneous (single phpunit.xml file suffices for all environments).
    • You’re using non-PHPUnit testing frameworks (e.g., Pest, Codeception) or Laravel’s built-in pest without PHPUnit.
    • Your CI/CD pipeline already handles configuration via environment variables or custom scripts (e.g., phpunit --configuration=path/to/file.xml).
    • You need advanced test filtering (e.g., by tags, annotations) beyond version-based selection (consider PHPUnit’s --filter or extensions like phpunit-parallel).
    • Your team prefers static configuration includes (e.g., <phpunit include="phpunit.xml.ci">) over dynamic selection.
    • You’re using Laravel’s Pest exclusively, as this package is PHPUnit-specific and may not integrate seamlessly.

How to Pitch It (Stakeholders)

For Executives: "This package automates the selection of PHPUnit test configurations based on version or environment, directly addressing our CI/CD bottlenecks and feature rollout risks. By eliminating manual configuration switches, we can reduce build times by ~20% and enable safer, faster testing for new features (e.g., Feature X). It’s a zero-cost, low-risk solution backed by Automattic’s Jetpack team, with no licensing or maintenance overhead. Ideal for scaling our Laravel-based products while keeping test suites reliable and adaptable to multi-version support."

For Engineering/DevOps: *"Need to run PHPUnit with dynamic configs (e.g., phpunit.xml.ci in GitHub Actions, phpunit.xml.local for dev)? This CLI tool wraps PHPUnit to auto-select configs by version—no more editing scripts. Works seamlessly with Laravel:

./vendor/bin/phpunit-select-config phpunit.xml.#

Key benefits:

  • CI/CD: Auto-select configs via phpunit-select-config phpunit.xml.ci.
  • Local Dev: Use phpunit-select-config phpunit.xml.local.
  • Feature Flags: Run phpunit-select-config phpunit.xml.feature-x for experimental tests.
  • Zero Maintenance: Lightweight, no dependencies beyond PHPUnit. Perfect for Laravel projects with multi-version support or complex test suites. Integrates with Artisan for a unified workflow."*

For QA/Test Teams: *"Tired of manually switching test configs in CI or local environments? This tool lets you define versioned configs (e.g., phpunit.xml.v8, phpunit.xml.v10) and have them selected automatically. Example:

# Runs phpunit.xml.v9 in CI
phpunit-select-config phpunit.xml.v#

Supports:

  • Parallel test execution (works with Laravel’s --parallel).
  • Fallback to default configs if selection fails.
  • Integration with Laravel’s Artisan for a unified workflow. No more context-switching between environments—just define your configs and let the tool handle the rest."*

For Product Managers: *"This package enables us to de-risk feature rollouts by isolating tests to version-specific configurations. For example:

  • Test Laravel 8 features with phpunit.xml.v8.
  • Test Laravel 10 features with phpunit.xml.v10.
  • Run CI-specific tests with phpunit.xml.ci. This reduces merge conflicts, speeds up feedback loops, and aligns with our roadmap for supporting multiple Laravel versions. It’s a low-effort, high-impact solution for improving test reliability."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor