PHPackages                             sanmai/phpunit-double-colon-syntax - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. sanmai/phpunit-double-colon-syntax

ActiveLibrary[Testing &amp; Quality](/categories/testing)

sanmai/phpunit-double-colon-syntax
==================================

Double Colon Syntax for PHPUnit

0.1.2(8mo ago)09.0k↓33.2%[3 PRs](https://github.com/sanmai/phpunit-double-colon-syntax/pulls)4BSD-3-ClausePHPPHP &gt;=7.1CI passing

Since Jul 21Pushed 2mo agoCompare

[ Source](https://github.com/sanmai/phpunit-double-colon-syntax)[ Packagist](https://packagist.org/packages/sanmai/phpunit-double-colon-syntax)[ GitHub Sponsors](https://github.com/sanmai)[ RSS](/packages/sanmai-phpunit-double-colon-syntax/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (9)Versions (9)Used By (4)

[![Total Downloads](https://camo.githubusercontent.com/30ba1ac74028fc03f102b8428242a223c98d6ff393979fd0c558ccca70de286f/68747470733a2f2f706f7365722e707567782e6f72672f73616e6d61692f706870756e69742d646f75626c652d636f6c6f6e2d73796e7461782f646f776e6c6f616473)](https://packagist.org/packages/sanmai/phpunit-double-colon-syntax)

Double Colon Syntax for PHPUnit
===============================

[](#double-colon-syntax-for-phpunit)

PHPUnit doesn't natively support the `file::method` syntax commonly used in other testing frameworks, such as pytest (`pytest test_file.py::test_method`). However, I found that AI assistants frequently suggest this syntax and even [strongly believe](https://tonsky.me/blog/gaslight-driven-development/) this syntax is a thing ([ChatGPT](https://chatgpt.com/s/t_687dfae8a4a481919793103c446e4d4f), [Gemini](https://g.co/gemini/share/402ff27b5910), [Claude](https://claude.ai/share/a1a12793-0eeb-4214-9d0a-87de3d4b5de2)), which is bonkers.

So it was always frustrating to see how an assistant generates a command using this syntax and fails, day after day, wasting time, tokens, context window, and my attention. Not anymore.

Now everyone can run individual test methods using the familiar `file::method` syntax:

```
vendor/bin/phpunit tests/ExampleTest.php::testItWorks
```

But before...

Installation
------------

[](#installation)

```
composer require --dev sanmai/phpunit-double-colon-syntax
```

That's it! No configuration needed. Works with PHPUnit 6 and above.

Usage
-----

[](#usage)

It works with multiple methods:

```
vendor/bin/phpunit tests/ExampleTest.php::test_one tests/ExampleTest.php::test_two
```

It does not work with `--filter`: you have to choose this or that syntax, not both.

How It Works
------------

[](#how-it-works)

Uses Composer's autoloader to intercept and transform arguments before PHPUnit starts. The `file::method` syntax becomes `file --filter method` automatically. It targets specifically `vendor/bin/phpunit` and ignores everything else.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance73

Regular maintenance activity

Popularity25

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 Bus Factor1

Top contributor holds 70.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~17 days

Total

3

Last Release

267d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/edcb8dde95c71b1c97c3c91e57d3548795fa2014c657744fb878e2be3b5949fc?d=identicon)[sanmai](/maintainers/sanmai)

---

Top Contributors

[![sanmai](https://avatars.githubusercontent.com/u/139488?v=4)](https://github.com/sanmai "sanmai (17 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")

---

Tags

chatgptclaudegeminihallucinationhallucination-mitigationllmphpunittestingphpunitdev

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/sanmai-phpunit-double-colon-syntax/health.svg)

```
[![Health](https://phpackages.com/badges/sanmai-phpunit-double-colon-syntax/health.svg)](https://phpackages.com/packages/sanmai-phpunit-double-colon-syntax)
```

###  Alternatives

[phpunit/phpunit

The PHP Unit Testing framework.

20.0k910.7M134.8k](/packages/phpunit-phpunit)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)[spatie/phpunit-snapshot-assertions

Snapshot testing with PHPUnit

69617.9M510](/packages/spatie-phpunit-snapshot-assertions)[dg/bypass-finals

Removes final keyword from source code on-the-fly and allows mocking of final methods and classes

57026.3M456](/packages/dg-bypass-finals)[orchestra/testbench-core

Testing Helper for Laravel Development

27043.7M310](/packages/orchestra-testbench-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
