Skip to content

Commit 137b4f3

Browse files
authored
Merge pull request #1266 from sarjona/phpunitfilter
[general] Fix unexisting PHPUnit filter test
2 parents 933ac0e + ffd46a9 commit 137b4f3

File tree

1 file changed

+9
-5
lines changed
  • general/development/tools/phpunit

1 file changed

+9
-5
lines changed

general/development/tools/phpunit/index.md

+9-5
Original file line numberDiff line numberDiff 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

169173
To 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"
172176
vendor/bin/phpunit --testsuite workshopform_accumulative_testsuite
173177
```
174178

@@ -186,7 +190,7 @@ vendor/bin/phpunit my/tests/filename.php
186190

187191
so, run this command in the CLI to see a real test in action:
188192

189-
```bash
193+
```bash title="Run a single test file"
190194
vendor/bin/phpunit cohort/tests/lib_test.php
191195
```
192196

0 commit comments

Comments
 (0)