fix: Compatible with Laravel 10

This commit is contained in:
Jon 2023-02-16 22:22:37 +08:00
parent 774857a93c
commit a237b71baa
3 changed files with 42 additions and 40 deletions

View File

@ -101,6 +101,10 @@ jobs:
- php: 8.0 - php: 8.0
laravel: 9.* laravel: 9.*
phpunit: ~9.0 phpunit: ~9.0
# Laravel 10.x
- php: 8.1
laravel: 10.*
phpunit: ~9.0
name: Laravel${{ matrix.laravel }}-PHP${{ matrix.php }} name: Laravel${{ matrix.laravel }}-PHP${{ matrix.php }}

View File

@ -21,9 +21,9 @@
"license": "Apache-2.0", "license": "Apache-2.0",
"require": { "require": {
"php": ">=7.1.0", "php": ">=7.1.0",
"illuminate/support": "~5.5|~6.0|~7.0|~8.0|~9.0", "illuminate/support": "~5.5|~6.0|~7.0|~8.0|~9.0|~10.0",
"illuminate/database": "~5.5|~6.0|~7.0|~8.0|~9.0", "illuminate/database": "~5.5|~6.0|~7.0|~8.0|~9.0|~10.0",
"illuminate/console": "~5.5|~6.0|~7.0|~8.0|~9.0", "illuminate/console": "~5.5|~6.0|~7.0|~8.0|~9.0|~10.0",
"casbin/casbin": "~3.1", "casbin/casbin": "~3.1",
"casbin/psr3-bridge": "^1.1" "casbin/psr3-bridge": "^1.1"
}, },
@ -31,7 +31,7 @@
"phpunit/phpunit": "~7.0|~8.0|~9.0", "phpunit/phpunit": "~7.0|~8.0|~9.0",
"php-coveralls/php-coveralls": "^2.4", "php-coveralls/php-coveralls": "^2.4",
"mockery/mockery": "^1.0", "mockery/mockery": "^1.0",
"laravel/laravel": "~5.5|~6.0|~7.0|~8.0|~9.0" "laravel/laravel": "~5.5|~6.0|~7.0|~8.0|~9.0|~10.0"
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {

View File

@ -1,36 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupStaticAttributes="false" backupGlobals="false"
bootstrap="vendor/autoload.php" bootstrap="vendor/autoload.php"
colors="true" colors="true"
convertErrorsToExceptions="true" processIsolation="false"
convertNoticesToExceptions="true" stopOnFailure="false"
convertWarningsToExceptions="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd">
processIsolation="false" <testsuites>
stopOnFailure="false"> <testsuite name="Application Test Suite">
<testsuites> <directory>./tests/</directory>
<testsuite name="Application Test Suite"> </testsuite>
<directory>./tests/</directory> </testsuites>
</testsuite> <filter>
</testsuites> <whitelist processUncoveredFilesFromWhitelist="true">
<filter> <directory suffix=".php">./src</directory>
<whitelist processUncoveredFilesFromWhitelist="true"> </whitelist>
<directory suffix=".php">./src</directory> </filter>
</whitelist> <logging>
</filter> <log type="coverage-clover" target="build/logs/clover.xml"/>
<logging> <log type="coverage-html" target="build/html"/>
<log type="coverage-clover" target="build/logs/clover.xml"/> </logging>
<log type="coverage-html" target="build/html"/> <php>
</logging> <env name="APP_ENV" value="testing"/>
<php> <env name="BCRYPT_ROUNDS" value="4"/>
<env name="APP_ENV" value="testing"/> <env name="CACHE_DRIVER" value="array"/>
<env name="BCRYPT_ROUNDS" value="4"/> <env name="MAIL_DRIVER" value="array"/>
<env name="CACHE_DRIVER" value="array"/> <env name="QUEUE_CONNECTION" value="sync"/>
<env name="MAIL_DRIVER" value="array"/> <env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_CONNECTION" value="sync"/>
<env name="SESSION_DRIVER" value="array"/> <env name="DB_DATABASE" value="lauthz"/>
<env name="DB_USERNAME" value="root"/>
<env name="DB_DATABASE" value="lauthz"/> </php>
<env name="DB_USERNAME" value="root"/> </phpunit>
</php>
</phpunit>