Skip to content

Commit 32a7b3e

Browse files
authored
Merge pull request #687 from flightphp/simplify-composer-scripts
simplify composer scripts
2 parents 4c6ff99 + d9cf6aa commit 32a7b3e

2 files changed

Lines changed: 25 additions & 13 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
extensions: curl, mbstring
2121
tools: composer:v2
2222
- run: composer install
23-
- run: composer test-ci
23+
- run: composer test

composer.json

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,30 @@
6464
"sort-packages": true
6565
},
6666
"scripts": {
67-
"test": "@php vendor/bin/phpunit",
68-
"test-watcher": "@php vendor/bin/phpunit-watcher watch",
69-
"test-ci": "@php vendor/bin/phpunit",
67+
"test": "phpunit",
68+
"test-watcher": [
69+
"phpunit-watcher || composer global require spatie/phpunit-watcher --dev",
70+
"phpunit-watcher watch"
71+
],
7072
"test-coverage": [
7173
"rm -f clover.xml",
7274
"@putenv XDEBUG_MODE=coverage",
73-
"@php vendor/bin/phpunit --coverage-html=coverage --coverage-clover=clover.xml",
74-
"@php vendor/bin/coverage-check clover.xml 100"
75+
"phpunit --coverage-html=coverage --coverage-clover=clover.xml",
76+
"coverage-check clover.xml 100"
77+
],
78+
"test-server": [
79+
"echo \"Running Test Server\"",
80+
"@php -S localhost:8000 -t tests/server"
81+
],
82+
"test-server-v2": [
83+
"echo \"Running Test Server\"",
84+
"@php -S localhost:8000 -t tests/server-v2"
85+
],
86+
"test-coverage:win": [
87+
"del clover.xml",
88+
"phpunit --coverage-html=coverage --coverage-clover=clover.xml",
89+
"coverage-check clover.xml 100"
7590
],
76-
"test-server": "echo \"Running Test Server\" && @php -S localhost:8000 -t tests/server/",
77-
"test-server-v2": "echo \"Running Test Server\" && @php -S localhost:8000 -t tests/server-v2/",
78-
"test-coverage:win": "del clover.xml && phpunit --coverage-html=coverage --coverage-clover=clover.xml && coverage-check clover.xml 100",
7991
"test-performance": [
8092
"echo \"Running Performance Tests...\"",
8193
"@php -S localhost:8077 -t tests/performance/ > /dev/null 2>&1 & echo $! > server.pid",
@@ -86,12 +98,12 @@
8698
"echo \"Performance Tests Completed.\""
8799
],
88100
"lint": "phpstan --no-progress --memory-limit=256M",
89-
"beautify": "phpcbf --standard=phpcs.xml",
101+
"beautify": "phpcbf",
90102
"phpcs": "phpcs",
91103
"post-install-cmd": [
92-
"php -r \"if (!file_exists('phpcs.xml')) copy('phpcs.xml.dist', 'phpcs.xml');\"",
93-
"php -r \"if (!file_exists('phpstan.neon')) copy('phpstan.dist.neon', 'phpstan.neon');\"",
94-
"php -r \"if (!file_exists('phpunit.xml')) copy('phpunit.xml.dist', 'phpunit.xml');\""
104+
"@php -r \"if (!file_exists('phpcs.xml')) copy('phpcs.xml.dist', 'phpcs.xml');\"",
105+
"@php -r \"if (!file_exists('phpstan.neon')) copy('phpstan.dist.neon', 'phpstan.neon');\"",
106+
"@php -r \"if (!file_exists('phpunit.xml')) copy('phpunit.xml.dist', 'phpunit.xml');\""
95107
]
96108
},
97109
"suggest": {

0 commit comments

Comments
 (0)