Skip to content

Commit 369d91b

Browse files
committed
Add tests
1 parent 33062b9 commit 369d91b

8 files changed

+1910
-25
lines changed

.github/workflows/ci.yaml

+39-14
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,53 @@ concurrency:
99
group: ${{ github.workflow }}-${{ github.ref }}
1010

1111
jobs:
12+
tests:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
php: [ 8.3, 8.4 ]
18+
dependency-versions: [ lowest, highest ]
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Setup PHP
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: '${{ matrix.php }}'
27+
coverage: none
28+
29+
- name: Install Composer packages
30+
uses: ramsey/composer-install@v3
31+
with:
32+
dependency-versions: '${{ matrix.dependency-versions }}'
33+
34+
- name: Run tests
35+
run: vendor/bin/phpunit --colors=always
36+
1237
phpstan:
1338
strategy:
1439
fail-fast: false
1540
matrix:
16-
php:
17-
- '7.2'
18-
- '8.3'
19-
- '8.4'
41+
php: [ 7.2, 8.3, 8.4 ]
42+
dependency-versions: [ lowest, highest ]
2043

2144
runs-on: ubuntu-latest
2245

2346
steps:
24-
- name: Checkout code
25-
uses: actions/checkout@v4
47+
- name: Checkout code
48+
uses: actions/checkout@v4
2649

27-
- name: Set up PHP
28-
uses: shivammathur/setup-php@v2
29-
with:
30-
php-version: ${{ matrix.php }}
50+
- name: Set up PHP
51+
uses: shivammathur/setup-php@v2
52+
with:
53+
php-version: ${{ matrix.php }}
3154

32-
- name: Install Composer packages
33-
uses: ramsey/composer-install@v3
55+
- name: Install Composer packages
56+
uses: ramsey/composer-install@v3
57+
with:
58+
dependency-versions: '${{ matrix.dependency-versions }}'
3459

35-
- name: Run PHPStan
36-
run: vendor/bin/phpstan --ansi
60+
- name: Run PHPStan
61+
run: vendor/bin/phpstan --ansi

composer.json

+8
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
"TicketSwap\\PHPStanErrorFormatter\\": "src/"
1414
}
1515
},
16+
"autoload-dev": {
17+
"psr-4": {
18+
"TicketSwap\\PHPStanErrorFormatter\\": "tests/"
19+
}
20+
},
1621
"extra": {
1722
"phpstan": {
1823
"includes": [
@@ -22,5 +27,8 @@
2227
},
2328
"config": {
2429
"sort-packages": true
30+
},
31+
"require-dev": {
32+
"phpunit/phpunit": "^11"
2533
}
2634
}

0 commit comments

Comments
 (0)