Skip to content

Commit 1a6b1fd

Browse files
authored
Merge pull request #1 from bst27/feature/tests
Feature/tests
2 parents 5c2acaa + 35a9b31 commit 1a6b1fd

30 files changed

+8936
-1
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Run tests in Sail’s PHP-Composer container
18+
run: |
19+
docker run --rm \
20+
-u "$(id -u):$(id -g)" \
21+
-v "${{ github.workspace }}":/var/www/html \
22+
-w /var/www/html \
23+
laravelsail/php84-composer:latest \
24+
sh -lc "composer install --no-interaction --prefer-dist && vendor/bin/phpunit"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.idea
2+
vendor

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,16 @@ php artisan vendor:publish --provider="Bst27\ImageProxy\ImageProxyServiceProvide
110110
This will create `config/image-proxy.php`.
111111

112112
---
113+
114+
## Tests
115+
116+
To run tests, you can execute the following command:
117+
118+
```bash
119+
docker run --rm -it \
120+
-u "$(id -u):$(id -g)" \
121+
-v "$PWD":/var/www/html \
122+
-w /var/www/html \
123+
laravelsail/php84-composer:latest \
124+
php vendor/bin/phpunit
125+
```

composer.json

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,30 @@
2323
"laravel/framework": "^11.0|^12.0",
2424
"spatie/image-optimizer": "^1.8",
2525
"ext-openssl": "*"
26+
},
27+
"require-dev": {
28+
"orchestra/testbench": "^10.4"
29+
},
30+
"autoload-dev": {
31+
"psr-4": {
32+
"Workbench\\App\\": "workbench/app/",
33+
"Workbench\\Database\\Factories\\": "workbench/database/factories/",
34+
"Workbench\\Database\\Seeders\\": "workbench/database/seeders/",
35+
"Bst27\\ImageProxy\\Tests\\": "tests/"
36+
}
37+
},
38+
"scripts": {
39+
"post-autoload-dump": [
40+
"@clear",
41+
"@prepare"
42+
],
43+
"clear": "@php vendor/bin/testbench package:purge-skeleton --ansi",
44+
"prepare": "@php vendor/bin/testbench package:discover --ansi",
45+
"build": "@php vendor/bin/testbench workbench:build --ansi",
46+
"serve": [
47+
"Composer\\Config::disableProcessTimeout",
48+
"@build",
49+
"@php vendor/bin/testbench serve --ansi"
50+
]
2651
}
27-
}
52+
}

0 commit comments

Comments
 (0)