How to run only one test in TestCase in NetBeans PHP?

1.6k views Asked by At

I can run all tests for current file, but how to run only one test?

2

There are 2 answers

1
David Harkness On

There are buttons in the Test Results pane to rerun only the tests that failed during the previous run, but I know of no way to run a single test. Right-click a test in that same pane to see if you get an option to run it alone. I'm not at work to test out that theory.

0
donfuxx On

There is a way to do it netbeans: Click Window -> Ide Tools -> Terminal and type:

phpunit --filter '/::testName$/' MyTest.php

Then click Enter. as far as I know there is no button or something in Netbeans that does that. So using terminal seems like the easiest way. It still is quite convenient though, because it should remember the history and later on you can just copy paste the test name.

Note that you may have to navigate to the test folder first or specify path to your Test file first in case Netbeans terminal doesn't open in your test project folder already