Skip to content

Commit d6480df

Browse files
authored
Add support for Laravel 11 (#31)
* Update composer.json * Migrate PHPUnit XML * Ignore PHPUnit 10 cache * Add Laravel 11 testbench * Update README.md * Run tests for Laravel 11 * Fix db collation error during Laravel 11 tests
1 parent 3b858a9 commit d6480df

File tree

5 files changed

+25
-17
lines changed

5 files changed

+25
-17
lines changed

.github/workflows/run-tests.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,16 @@ jobs:
88
strategy:
99
fail-fast: true
1010
matrix:
11-
php: [ 8.0, 8.1 ]
12-
laravel: [ 8.*, 9.*, 10.* ]
11+
php: [ 8.0, 8.1, 8.2, 8.3 ]
12+
laravel: [ 8.*, 9.*, 10.*, 11.* ]
1313
dependency-version: [ prefer-stable ]
1414
exclude:
1515
- laravel: 10.*
1616
php: 8.0
17+
- laravel: 11.*
18+
php: 8.0
19+
- laravel: 11.*
20+
php: 8.1
1721
include:
1822
- laravel: 6.*
1923
php: 7.2
@@ -36,6 +40,8 @@ jobs:
3640
testbench: 7.*
3741
- laravel: 10.*
3842
testbench: 8.*
43+
- laravel: 11.*
44+
testbench: 9.*
3945

4046
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
4147

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
composer.lock
44
phpunit.xml
55
/.phpunit.result.cache
6+
/.phpunit.cache

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ I know you can get punished for this, but you are one of the hopes of those inno
1616
---
1717

1818
[![GitHub release](https://img.shields.io/github/release/codezero-be/laravel-unique-translation.svg?style=flat-square)](https://github.com/codezero-be/laravel-unique-translation/releases)
19-
[![Laravel](https://img.shields.io/badge/laravel-10-red?style=flat-square&logo=laravel&logoColor=white)](https://laravel.com)
19+
[![Laravel](https://img.shields.io/badge/laravel-11-red?style=flat-square&logo=laravel&logoColor=white)](https://laravel.com)
2020
[![License](https://img.shields.io/packagist/l/codezero/laravel-unique-translation.svg?style=flat-square)](LICENSE.md)
2121
[![Build Status](https://img.shields.io/github/actions/workflow/status/codezero-be/laravel-unique-translation/run-tests.yml?style=flat-square&logo=github&logoColor=white&label=tests)](https://github.com/codezero-be/laravel-unique-translation/actions)
2222
[![Code Coverage](https://img.shields.io/codacy/coverage/bb5f876fb1a94aa0a426fd31a2656e5b/master?style=flat-square)](https://app.codacy.com/gh/codezero-be/laravel-unique-translation)
@@ -42,7 +42,7 @@ This package also supports [`spatie/nova-translatable`](https://github.com/spati
4242
- PHP ^7.2 or PHP ^8.0
4343
- MySQL >= 5.7
4444
- [Laravel](https://laravel.com/) >= 6
45-
- [spatie/laravel-translatable](https://github.com/spatie/laravel-translatable) ^4.4|^5.0
45+
- [spatie/laravel-translatable](https://github.com/spatie/laravel-translatable) ^4.4|^5.0|^6.0
4646
- [spatie/nova-translatable](https://github.com/spatie/nova-translatable/) ^3.0
4747
- [filamentphp/spatie-laravel-translatable-plugin](https://github.com/filamentphp/spatie-laravel-translatable-plugin) ^3.0
4848

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
"php": "^7.2|^8.0"
2626
},
2727
"require-dev": {
28-
"orchestra/testbench": "^4.0|^5.0|^6.0|^7.0|^8.0",
29-
"phpunit/phpunit": "^8.0|^9.0",
28+
"orchestra/testbench": "^4.0|^5.0|^6.0|^7.0|^8.0|^9.0",
29+
"phpunit/phpunit": "^8.0|^9.0|^10.0",
3030
"spatie/laravel-translatable": "^4.4|^5.0|^6.0"
3131
},
3232
"autoload": {

phpunit.xml.dist

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit backupGlobals="false"
3-
backupStaticAttributes="false"
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
backupGlobals="false"
44
bootstrap="vendor/autoload.php"
55
colors="true"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
8-
convertWarningsToExceptions="true"
96
processIsolation="false"
10-
stopOnFailure="false">
7+
stopOnFailure="false"
8+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
9+
cacheDirectory=".phpunit.cache"
10+
backupStaticProperties="false">
1111
<testsuites>
1212
<testsuite name="CodeZero">
1313
<directory suffix="Test.php">./tests</directory>
1414
</testsuite>
1515
</testsuites>
16-
<filter>
17-
<whitelist processUncoveredFilesFromWhitelist="true">
18-
<directory suffix=".php">./src</directory>
19-
</whitelist>
20-
</filter>
2116
<php>
2217
<env name="APP_ENV" value="testing"/>
2318
<env name="CACHE_DRIVER" value="array"/>
2419
<env name="SESSION_DRIVER" value="array"/>
2520
<env name="QUEUE_DRIVER" value="sync"/>
2621
<env name="DB_CONNECTION" value="mysql"/>
2722
<env name="DB_DATABASE" value="testing"/>
23+
<env name="DB_COLLATION" value="utf8mb4_unicode_ci"/>
2824
<env name="DB_USERNAME" value="root"/>
2925
<env name="DB_PASSWORD" value=""/>
3026
</php>
27+
<source>
28+
<include>
29+
<directory suffix=".php">./src</directory>
30+
</include>
31+
</source>
3132
</phpunit>

0 commit comments

Comments
 (0)