From 3029ba202e604131ddfc4cd62da9c3768eb6563d Mon Sep 17 00:00:00 2001 From: Erik Lindegren Date: Wed, 26 Apr 2023 23:29:57 +0200 Subject: [PATCH 1/7] Allow Laravel 10 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 7f94f31..005be68 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "Admin area tool utilities for Laravel", "license": "MIT", "require": { - "laravel/framework": "^9.0", + "laravel/framework": "^9.0 || ^10.0", "laravel/ui": "^4.0" }, "require-dev": { From 0dcedc6ffc45f81e00dd52a3f8af3115630e85d6 Mon Sep 17 00:00:00 2001 From: Erik Lindegren Date: Fri, 28 Apr 2023 20:04:57 +0200 Subject: [PATCH 2/7] Update PHPUnit XML configuration Auto-update the PHPUnit XML configuration (as the old schema is deprecated) by running phpunit with the flag "--migrate-configuration" --- phpunit.xml.dist | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 0b48445..c4a1729 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,23 +1,6 @@ - - - - ./src - - + + ./tests @@ -33,4 +16,9 @@ + + + ./src + + From 5942df4fb053100704f8b306d5d10ecedb945c60 Mon Sep 17 00:00:00 2001 From: Erik Lindegren Date: Fri, 28 Apr 2023 20:12:39 +0200 Subject: [PATCH 3/7] Remove the ./tests folder from the PHPUnit testsuites When the ./tests folder was part of the PHPUnit testsuites configuration it tried to run the abstract classes defined there as proper tests, which generated these warnings: There were 3 PHPUnit test runner warnings: 1) Class Kontenta\Kontour\Tests\DuskTest declared in /var/www/html/vendor/kontenta/kontour/tests/DuskTest.php is abstract 2) Class Kontenta\Kontour\Tests\IntegrationTest declared in /var/www/html/vendor/kontenta/kontour/tests/IntegrationTest.php is abstract 3) Class Kontenta\Kontour\Tests\UnitTest declared in /var/www/html/vendor/kontenta/kontour/tests/UnitTest.php is abstract It also meant that it ran each test found in the sub-folders Browser and Feature twice. --- phpunit.xml.dist | 3 --- 1 file changed, 3 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index c4a1729..55f2306 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -2,9 +2,6 @@ - - ./tests - ./tests/Feature From 6c6d4a0f7ddd19605dd5c61b9ab917d0c705f57c Mon Sep 17 00:00:00 2001 From: Erik Lindegren Date: Fri, 28 Apr 2023 20:17:56 +0200 Subject: [PATCH 4/7] Update table name for the password resets data Update the table name used in the tests for the password resets. Laravel 10 is now using password_reset_tokens as the table name for this. --- tests/IntegrationTestSetupTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/IntegrationTestSetupTrait.php b/tests/IntegrationTestSetupTrait.php index 95d68f3..06118fc 100644 --- a/tests/IntegrationTestSetupTrait.php +++ b/tests/IntegrationTestSetupTrait.php @@ -48,7 +48,7 @@ protected function getEnvironmentSetUp($app) ]); $app['config']->set('auth.passwords.admins', [ 'provider' => 'admins', - 'table' => 'password_resets', + 'table' => 'password_reset_tokens', 'expire' => 60, ]); $app['config']->set('kontour.guard', 'admin'); From 8a69836ef07ea4b3b4e5235013af46debd3f1b58 Mon Sep 17 00:00:00 2001 From: Erik Lindegren Date: Fri, 28 Apr 2023 20:26:33 +0200 Subject: [PATCH 5/7] Update GitHub Actions for Laravel 10 --- .github/workflows/run-tests.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 68fd176..d253332 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -14,11 +14,16 @@ jobs: matrix: os: [ubuntu-latest] php: [8.2, 8.1, 8.0] - laravel: [9.*] + laravel: [10.*, 9.*] stability: [prefer-lowest, prefer-stable] - include: + include: + - laravel: 10.* + testbench: 8.* - laravel: 9.* testbench: 7.* + exclude: + - laravel: 10.* + php: 8.0 name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} From 0b313d9c52e594128855ae3311682c80d0753517 Mon Sep 17 00:00:00 2001 From: Erik Lindegren Date: Fri, 28 Apr 2023 20:53:05 +0200 Subject: [PATCH 6/7] Set password resets table name from config For the tests use the same password resets database table for the admin users as for the normal users --- tests/IntegrationTestSetupTrait.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/IntegrationTestSetupTrait.php b/tests/IntegrationTestSetupTrait.php index 06118fc..be30256 100644 --- a/tests/IntegrationTestSetupTrait.php +++ b/tests/IntegrationTestSetupTrait.php @@ -46,9 +46,11 @@ protected function getEnvironmentSetUp($app) 'driver' => 'eloquent', 'model' => User::class, ]); + + // Use the same password reset table as for the users $app['config']->set('auth.passwords.admins', [ 'provider' => 'admins', - 'table' => 'password_reset_tokens', + 'table' => $app['config']['auth']['passwords']['users']['table'], 'expire' => 60, ]); $app['config']->set('kontour.guard', 'admin'); From 1d49ed305cb503a254d08bdce108b2b1ab7bdb97 Mon Sep 17 00:00:00 2001 From: Erik Lindegren Date: Fri, 28 Apr 2023 21:08:19 +0200 Subject: [PATCH 7/7] Update version requirements in docs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 20fbb49..131b71e 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ authentication, authorization, validation, views, etc. Kontour is there to provide enhancements and reusable elements for your admin area. -You need **Laravel 9** to use the latest version of this package. +You need at least **Laravel 9** to use the latest version of this package. ## Using Kontour in a Laravel app