Skip to content

Commit

Permalink
chore: prepare for laravel 11 (#61)
Browse files Browse the repository at this point in the history
* chore: prepare for laravel 11
* fix: composer based on matrix values
* fix: ignore test classes for phpunit
* fix: autoload test models in dev
  • Loading branch information
joostdebruijn authored Feb 24, 2024
1 parent 3c3eb31 commit 3e2a1f5
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 36 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Testing Laravel with MySQL
on: [pull_request]
jobs:
laravel:
name: Laravel (PHP ${{ matrix.php-versions }})
name: Laravel ${{ matrix.laravel }} (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
env:
DB_DATABASE: logtodb
Expand All @@ -29,10 +29,16 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['8.2']
laravel: [ ^10.0, ^11.0 ]
php: ['8.2', '8.3']
include:
- laravel: ^10.0
testbench: ^8.0
- laravel: ^11.0
testbench: ^9.0
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Start MongoDB
uses: supercharge/mongodb-github-action@1.10.0
Expand All @@ -43,7 +49,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
php-version: ${{ matrix.php }}
extensions: mbstring, dom, fileinfo, mysql, mongodb
coverage: xdebug

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

- name: Install Composer dependencies
run: composer install --no-progress
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-progress
- name: Test with phpunit
run: vendor/bin/phpunit --coverage-clover ./coverage.xml
Expand Down
26 changes: 20 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
{
"name": "danielme85/laravel-log-to-db",
"description": "Custom Laravel Log channel handler that can store log events to SQL or MongoDB databases. Uses Laravel native logging functionality.",
"keywords": ["laravel", "logging", "log", "database", "db", "mysql", "sql", "mongodb"],
"keywords": [
"laravel",
"logging",
"log",
"database",
"db",
"mysql",
"sql",
"mongodb"
],
"type": "library",
"license": "MIT",
"authors": [
Expand All @@ -12,14 +21,14 @@
],
"require": {
"php": "^8.1",
"illuminate/support": "^10.0"
"illuminate/support": "^10.0|^11.0"
},
"require-dev": {
"ext-mongodb": "*",
"phpunit/phpunit": "9.*",
"orchestra/testbench": "^8.0",
"phpunit/phpunit": "^10.0",
"orchestra/testbench": "^8.0|^9.0",
"mockery/mockery": "^1.5",
"nunomaduro/collision": "^7.0",
"nunomaduro/collision": "^7.0|^8.0",
"mongodb/laravel-mongodb": "^4"
},
"suggest": {
Expand All @@ -30,6 +39,11 @@
"danielme85\\LaravelLogToDB\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"TestModels\\": "tests/TestModels"
}
},
"extra": {
"laravel": {
"providers": [
Expand All @@ -41,4 +55,4 @@
}
},
"minimum-stability": "dev"
}
}
1 change: 1 addition & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<testsuites>
<testsuite name="Test Suite danielme85/laravel-log-to-db">
<directory suffix=".php">./tests/</directory>
<exclude>./tests/TestModels</exclude>
</testsuite>
</testsuites>
<source>
Expand Down
25 changes: 0 additions & 25 deletions phpunit.xml.bak

This file was deleted.

0 comments on commit 3e2a1f5

Please sign in to comment.