Skip to content

Commit 1e29d58

Browse files
test(phpunit): Rework coding-standards composer.json
1 parent 282a938 commit 1e29d58

File tree

2 files changed

+10
-18
lines changed

2 files changed

+10
-18
lines changed

docs/DEVELOPER.md

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,7 @@ Finally, run
212212

213213

214214
```bash
215-
ddev exec BOUNCER_KEY=your-bouncer-key LAPI_URL=http://crowdsec:8080 MEMCACHED_DSN=memcached://memcached:11211
216-
REDIS_DSN=redis://redis:6379 /usr/bin/php ./my-own-modules/crowdsec-php-lib/vendor/bin/phpunit --testdox --colors
217-
--exclude-group ignore ./my-own-modules/crowdsec-php-lib/tests/Integration/IpVerificationTest.php
215+
ddev exec BOUNCER_KEY=your-bouncer-key LAPI_URL=http://crowdsec:8080 MEMCACHED_DSN=memcached://memcached:11211 REDIS_DSN=redis://redis:6379 /usr/bin/php ./my-own-modules/crowdsec-php-lib/vendor/bin/phpunit --testdox --colors --exclude-group ignore ./my-own-modules/crowdsec-php-lib/tests/Integration/IpVerificationTest.php
218216
```
219217

220218
For geolocation Unit Test, you should first put 2 free MaxMind databases in the `tests` folder : `GeoLite2-City.mmdb`
@@ -363,16 +361,6 @@ ddev psalm ./my-own-modules/crowdsec-php-lib/tools/coding-standards ./my-own-mod
363361

364362
In order to generate a code coverage report, you have to:
365363

366-
- Remove the old php unit version used to test on old php version:
367-
```bash
368-
ddev composer install --no-dev --working-dir ./my-own-modules/crowdsec-php-lib
369-
```
370-
371-
- Update composer dependency in the coding-standards folder:
372-
```bash
373-
ddev composer update --working-dir=./my-own-modules/crowdsec-php-lib/tools/coding-standards
374-
```
375-
376364
- Enable `xdebug`:
377365
```bash
378366
ddev xdebug

tools/coding-standards/composer.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,18 @@
77
"squizlabs/php_codesniffer": "@stable",
88
"vimeo/psalm": "@stable",
99
"phpunit/phpunit": "^9.3",
10-
"phpunit/php-code-coverage" : "@stable"
10+
"phpunit/php-code-coverage" : "@stable",
11+
"crowdsec/bouncer": "@dev"
1112
},
1213
"autoload": {
13-
"files": ["../../vendor/autoload.php"]
14-
},
15-
"autoload-dev": {
1614
"psr-4": {
1715
"CrowdSecBouncer\\Tests\\": "../../tests/"
1816
}
17+
},
18+
"repositories": {
19+
"crowdsec-bouncer-lib": {
20+
"type": "path",
21+
"url": "../../"
22+
}
1923
}
20-
}
24+
}

0 commit comments

Comments
 (0)