Skip to content

Commit 23d0093

Browse files
author
Greg Bowler
authored
Unit tests (#3)
* build: hard dependencies * test: implement unit tests
1 parent 442617a commit 23d0093

7 files changed

Lines changed: 2197 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,25 @@ jobs:
4242
- name: PHP Static Analysis
4343
uses: php-actions/phpstan@v2
4444
with:
45-
path: src/
45+
path: src/
46+
47+
phpunit:
48+
runs-on: ubuntu-latest
49+
needs: [ composer ]
50+
51+
steps:
52+
- uses: actions/download-artifact@v2
53+
with:
54+
name: build-artifact
55+
path: /tmp/github-actions
56+
57+
- name: Extract build archive
58+
run: tar -xvf /tmp/github-actions/build.tar ./
59+
60+
- name: PHP Unit tests
61+
uses: php-actions/phpunit@v3
62+
with:
63+
php_version: '8.1'
64+
php_extensions: xdebug
65+
configuration: test/phpunit/phpunit.xml
66+
bootstrap: vendor/autoload.php

composer.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
},
1010

1111
"require-dev": {
12-
"phpstan/phpstan": "v1.8.0"
12+
"phpstan/phpstan": "v1.8.0",
13+
"phpunit/phpunit": "v9.5.21"
1314
},
1415

1516
"authors": [
@@ -30,5 +31,10 @@
3031
"psr-4": {
3132
"Gt\\TypeSafeGetter\\": "./src"
3233
}
34+
},
35+
"autoload-dev": {
36+
"psr-4": {
37+
"Gt\\TypeSafeGetter\\Test\\": "./test/phpunit"
38+
}
3339
}
3440
}

0 commit comments

Comments
 (0)