Skip to content

Commit 3e2a1f5

Browse files
chore: prepare for laravel 11 (#61)
* chore: prepare for laravel 11 * fix: composer based on matrix values * fix: ignore test classes for phpunit * fix: autoload test models in dev
1 parent 3c3eb31 commit 3e2a1f5

File tree

4 files changed

+34
-36
lines changed

4 files changed

+34
-36
lines changed

.github/workflows/unittest.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Testing Laravel with MySQL
33
on: [pull_request]
44
jobs:
55
laravel:
6-
name: Laravel (PHP ${{ matrix.php-versions }})
6+
name: Laravel ${{ matrix.laravel }} (PHP ${{ matrix.php }})
77
runs-on: ubuntu-latest
88
env:
99
DB_DATABASE: logtodb
@@ -29,10 +29,16 @@ jobs:
2929
strategy:
3030
fail-fast: false
3131
matrix:
32-
php-versions: ['8.2']
32+
laravel: [ ^10.0, ^11.0 ]
33+
php: ['8.2', '8.3']
34+
include:
35+
- laravel: ^10.0
36+
testbench: ^8.0
37+
- laravel: ^11.0
38+
testbench: ^9.0
3339
steps:
3440
- name: Checkout
35-
uses: actions/checkout@v3
41+
uses: actions/checkout@v4
3642

3743
- name: Start MongoDB
3844
uses: supercharge/[email protected]
@@ -43,7 +49,7 @@ jobs:
4349
- name: Setup PHP
4450
uses: shivammathur/setup-php@v2
4551
with:
46-
php-version: ${{ matrix.php-versions }}
52+
php-version: ${{ matrix.php }}
4753
extensions: mbstring, dom, fileinfo, mysql, mongodb
4854
coverage: xdebug
4955

@@ -53,7 +59,9 @@ jobs:
5359
# run: sudo systemctl start mysql.service
5460

5561
- name: Install Composer dependencies
56-
run: composer install --no-progress
62+
run: |
63+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
64+
composer update --prefer-dist --no-interaction --no-progress
5765
5866
- name: Test with phpunit
5967
run: vendor/bin/phpunit --coverage-clover ./coverage.xml

composer.json

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
{
22
"name": "danielme85/laravel-log-to-db",
33
"description": "Custom Laravel Log channel handler that can store log events to SQL or MongoDB databases. Uses Laravel native logging functionality.",
4-
"keywords": ["laravel", "logging", "log", "database", "db", "mysql", "sql", "mongodb"],
4+
"keywords": [
5+
"laravel",
6+
"logging",
7+
"log",
8+
"database",
9+
"db",
10+
"mysql",
11+
"sql",
12+
"mongodb"
13+
],
514
"type": "library",
615
"license": "MIT",
716
"authors": [
@@ -12,14 +21,14 @@
1221
],
1322
"require": {
1423
"php": "^8.1",
15-
"illuminate/support": "^10.0"
24+
"illuminate/support": "^10.0|^11.0"
1625
},
1726
"require-dev": {
1827
"ext-mongodb": "*",
19-
"phpunit/phpunit": "9.*",
20-
"orchestra/testbench": "^8.0",
28+
"phpunit/phpunit": "^10.0",
29+
"orchestra/testbench": "^8.0|^9.0",
2130
"mockery/mockery": "^1.5",
22-
"nunomaduro/collision": "^7.0",
31+
"nunomaduro/collision": "^7.0|^8.0",
2332
"mongodb/laravel-mongodb": "^4"
2433
},
2534
"suggest": {
@@ -30,6 +39,11 @@
3039
"danielme85\\LaravelLogToDB\\": "src"
3140
}
3241
},
42+
"autoload-dev": {
43+
"psr-4": {
44+
"TestModels\\": "tests/TestModels"
45+
}
46+
},
3347
"extra": {
3448
"laravel": {
3549
"providers": [
@@ -41,4 +55,4 @@
4155
}
4256
},
4357
"minimum-stability": "dev"
44-
}
58+
}

phpunit.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<testsuites>
99
<testsuite name="Test Suite danielme85/laravel-log-to-db">
1010
<directory suffix=".php">./tests/</directory>
11+
<exclude>./tests/TestModels</exclude>
1112
</testsuite>
1213
</testsuites>
1314
<source>

phpunit.xml.bak

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)