File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
general/development/tools/phpunit Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -160,15 +160,19 @@ In IDEs, you may need to specify the path to the PHPUnit configuration file. Use
160160
161161#### Running a single test quickly (PHPUnit 9)
162162
163- The fastest way to run a single test in PHPUnit 9.5 and higher (Moodle 3.11 and higher) is to use the filter argument:
163+ The fastest way to run a single test in PHPUnit 9.5 and higher is to use the filter argument:
164164
165- ``` bash
166- vendor/bin/phpunit --filter tool_dataprivacy_metadata_registry_testcase
165+ ``` bash title="Run a single test"
166+ vendor/bin/phpunit --filter metadata_registry_test
167+ ```
168+
169+ ``` bash title="Run a single test method"
170+ vendor/bin/phpunit --filter test_get_registry_metadata_count
167171```
168172
169173To run all tests provided by the single component, use suite and the name it has in the phpunit.xml file. Example:
170174
171- ``` bash
175+ ``` bash title="Run all tests from the workshop accumulative grading plugin"
172176vendor/bin/phpunit --testsuite workshopform_accumulative_testsuite
173177```
174178
@@ -186,7 +190,7 @@ vendor/bin/phpunit my/tests/filename.php
186190
187191so, run this command in the CLI to see a real test in action:
188192
189- ``` bash
193+ ``` bash title="Run a single test file"
190194vendor/bin/phpunit cohort/tests/lib_test.php
191195```
192196
You can’t perform that action at this time.
0 commit comments