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 versions (e.g., PHPUnit 8, 9, 10) without manual configuration switches, critical for projects supporting legacy and modern stacks (e.g., Laravel 8/9/10 compatibility).
  • CI/CD Pipeline Optimization: Reduces flakiness in CI by dynamically selecting test configurations (e.g., phpunit.xml.ci for GitHub Actions, phpunit.xml.local for local dev), aligning with DevOps goals for faster, more reliable builds.
  • Feature-Flagged Testing: Supports conditional test execution (e.g., @group feature-x or version-specific configs) without modifying core test files, enabling safer rollouts of experimental features in Laravel applications.
  • Build vs. Buy: Avoids reinventing a custom solution for versioned test configurations, leveraging a lightweight, Automattic-backed package with minimal maintenance overhead.
  • 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.
  • 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.

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.
  • 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.

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 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."

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/flag—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."*

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."*
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.
directorytree/privacy-filter-classifier
directorytree/privacy-filter
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi
splash/scopes
splash/toolkit
testo/output-teamcity
testo/bridge-symfony
spatie/flare-daemon-runtime