LMSouq
php-dev Open

How to run single test method with phpunit?

AL
Alex
1 month ago
3 views
Problem Description
I am struggling to run a single test method named `testSaveAndDrop` in the file `escalation/EscalationGroupTest.php` with `phpunit`. I tried the following combinations: phpunit EscalationGroupTest escalation/EscalationGroupTest.php --filter=escalation/EscalationGroupTest.php::testSaveAndDrop phpunit EscalationGroupTest escalation/EscalationGroupTest.php --filter=EscalationGroupTest.php::testSaveAndDrop phpunit EscalationGroupTest escalation/EscalationGroupTest.php --filter=EscalationGroupTest::testSaveAndDrop phpunit EscalationGroupTest escalation/EscalationGroupTest.php --filter=testSaveAndDrop In each case *all* test methode in the file `escalation/EscalationGroupTest.php` are executed. How to select just ONE method instead? The name of the class is `EscalationGroupTest` and the version of `phpunit` is 3.2.8.

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base