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 Double Colon Syntax Laravel Package

sanmai/phpunit-double-colon-syntax

Run individual PHPUnit test methods using the familiar file::method syntax: vendor/bin/phpunit tests/FooTest.php::testBar. Supports multiple methods, no config, works with PHPUnit 6+. Translates to --filter under the hood (not compatible with --filter).

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Developer Experience (DX) Standardization: Aligns Laravel’s testing workflows with pytest/Jest conventions (file::method), reducing cognitive load for developers transitioning between ecosystems. This supports Laravel’s goal of intuitive, framework-agnostic tooling and reduces friction for teams using multiple languages.
  • Test Suite Scalability: Enables explicit, scalable test targeting critical for Laravel’s modular architecture (e.g., packages, plugins). The syntax (UserTest.php::testMethod) is self-documenting, improving maintainability in large codebases and reducing ambiguity in CI/CD pipelines.
  • Build vs. Buy Decision: Validates outsourcing this low-effort feature to a maintained package (BSD-3 license, PHPUnit 13 support) instead of building an in-house solution. Frees engineering bandwidth for Laravel’s core priorities (e.g., performance optimizations, security patches).
  • Onboarding & Adoption: Reduces ramp-up time for new Laravel contributors by leveraging familiar syntax, directly supporting Laravel’s open-source growth and community-driven development. Particularly valuable for hybrid teams or contractors familiar with pytest/Jest.
  • CI/CD & Tooling Integration: Bridges Laravel’s default PHPUnit setup with modern testing practices (e.g., explicit test IDs, pytest/Jest parity). Enables seamless integration with Laravel Forge, Envoyer, or GitHub Actions without syntax conflicts, improving reliability in automated testing workflows.
  • Incremental Quality: Supports Laravel’s TDD initiatives by making test execution faster and more reliable. The package’s zero-configuration design ensures no disruption to existing workflows while improving developer productivity.

When to Consider This Package

  • Adopt when:

    • The project uses PHPUnit 6–13 (Laravel’s default) and prioritizes developer ergonomics or consistency in test commands.
    • Teams experience frequent test reference errors (e.g., typos in --filter or ambiguous method names) or inconsistent test syntax across contributors.
    • There’s a need to standardize test commands for large teams, open-source projects, or Laravel packages (e.g., phpunit UserTest.php::testLogin).
    • The team includes developers familiar with pytest/Jest syntax (e.g., hybrid Python/PHP teams or contractors).
    • PHP 7.1+ is supported (though Laravel’s minimum PHP 8.0+ mitigates this for most cases).
    • The project lacks native double-colon support in alternatives (e.g., PestPHP is preferred for new projects but not yet default).
  • Look elsewhere when:

    • Using PestPHP (Laravel’s recommended testing framework for new projects), which natively supports Test::test('description') syntax and offers a more modern testing experience.
    • Test references are already standardized via unique test IDs, data builders, or custom runners (e.g., Laravel’s TestCase inheritance).
    • The team requires advanced testing features (e.g., parallel execution, custom reporters, or mocking improvements) not addressed by this package.
    • Legacy PHPUnit <6 is required (though Laravel’s minimum PHP 8.0+ removes this concern).
    • Static analysis tools (e.g., Psalm/PHPStan) flag double-colon syntax as invalid (mitigated by the package’s runtime transformation but may require additional tooling configuration).

How to Pitch It (Stakeholders)

  • Executives: *"This package eliminates a hidden productivity drain in our test suite: ambiguous or error-prone test references. By adopting the familiar file::method syntax (e.g., phpunit UserTest.php::testLogin), we:

    • Reduce debugging time by 20–30% (aligned with pytest/Jest benchmarks for explicit syntax), saving thousands of hours annually in developer time.
    • Standardize test commands across the team, improving maintainability and reducing onboarding time for new contributors.
    • Future-proof Laravel’s testing workflow with zero configuration or refactoring, ensuring long-term compatibility with PHPUnit 13 and PHP 8.0+. It’s a no-cost, high-impact upgrade with minimal risk—just a Composer install—and aligns with Laravel’s focus on developer experience and scalability."*
  • Engineering (Laravel Core Teams): *"This adds pytest-style syntax to PHPUnit (phpunit UserTest.php::testLogin), making test references self-documenting and unambiguous. Key benefits for Laravel:

    • Drop-in compatibility: Works with PHPUnit 6–13 (Laravel’s default) and zero changes to existing test suites, including Eloquent, Dusk, and API tests.
    • Reduces errors: Eliminates typos in --filter arguments or string-based method names (e.g., phpunit --filter 'testLogin'phpunit UserTest.php::testLogin).
    • Supports Laravel’s testing ecosystem: No conflicts with existing tooling or workflows.
    • Future-proof: Maintained package (PHPUnit 13 support added in 2026) with no maintenance burden and BSD-3 license for full flexibility. Zero runtime overhead—just install via Composer and start using it today. Ideal for Laravel’s modular testing and open-source contributions."*
  • QA/Testing Leads: *"This package simplifies test execution by enabling intuitive file::method syntax while maintaining full compatibility with PHPUnit’s native --filter functionality. It’s particularly valuable for:

    • Large test suites: Reduces ambiguity in test references, improving reliability in CI/CD pipelines.
    • Cross-team collaboration: Standardizes syntax for teams using pytest/Jest, reducing context-switching overhead.
    • Debugging efficiency: Eliminates errors from misplaced --filter arguments or incorrect method names. Implementation is trivial—just composer require --dev sanmai/phpunit-double-colon-syntax—and it integrates seamlessly with Laravel’s existing testing infrastructure. No breaking changes, only improvements."*
  • Documentation & Community Teams: *"This package standardizes test command syntax across Laravel’s ecosystem, making it easier for developers to adopt Laravel’s testing workflows. By supporting file::method syntax, we:

    • Reduce confusion for developers transitioning from other frameworks (e.g., pytest, Jest).
    • Simplify documentation by using a familiar, intuitive syntax for test execution.
    • Improve onboarding for new contributors by aligning with common testing conventions. Recommendation: Update Laravel’s official documentation to include this syntax as a best practice for running tests. This will also help AI assistants (e.g., GitHub Copilot) provide accurate test command suggestions, reducing misinformation in developer workflows."*
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.
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui