Skip to content

Commit

Permalink
Add Laravel 10.x Support (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
rawilk authored Mar 20, 2023
1 parent f25f8d9 commit bd4b401
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ jobs:
fail-fast: true
matrix:
php: [8.1]
laravel: [9.*, 8.*,]
laravel: [10.*, 9.*, 8.*,]
dependency-version: [prefer-lowest, prefer-stable]
include:
- laravel: 10.*
testbench: 8.*
- laravel: 9.*
testbench: 7.*
- laravel: 8.*
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
],
"require": {
"php": "^8.0|^8.1",
"illuminate/database": "^8.0|^9.0",
"illuminate/support": "^8.0|^9.0",
"illuminate/database": "^8.0|^9.0|^10.0",
"illuminate/support": "^8.0|^9.0|^10.0",
"spatie/laravel-package-tools": "^1.2|^1.13"
},
"require-dev": {
"doctrine/dbal": "^3.5",
"laravel/pint": "^1.2",
"mockery/mockery": "^1.4.2",
"orchestra/testbench": "^6.5|^7.0",
"orchestra/testbench": "^6.5|^7.0|^8.0",
"pestphp/pest": "^1.22",
"pestphp/pest-plugin-laravel": "^1.3",
"pestphp/pest-plugin-parallel": "^1.0|^1.2",
Expand Down
11 changes: 10 additions & 1 deletion tests/Feature/SettingsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@
'settings.cache' => false,
'settings.encryption' => false,
]);

// The Database driver doesn't seem to be using the same Sqlite connection the tests are using, so
// we'll force it to here. This should fix issues with the settings table not existing when the
// driver queries it.
$driver = Settings::getDriver();
$reflection = new ReflectionClass($driver);

$property = $reflection->getProperty('connection');
$property->setAccessible(true);
$property->setValue($driver, DB::connection());
});

it('can determine if a setting has been persisted', function () {
Expand Down Expand Up @@ -283,7 +293,6 @@ function resetQueryCount(): void
* @see https://developer.wordpress.org/reference/functions/is_serialized/
*
* @param string|mixed $data
* @return bool
*/
function isSerialized(mixed $data): bool
{
Expand Down

0 comments on commit bd4b401

Please sign in to comment.