From a25082ff8b5f61c903c29635f8b6e5c51f8f36ce Mon Sep 17 00:00:00 2001 From: mchev Date: Tue, 12 Mar 2024 13:42:03 +0100 Subject: [PATCH 1/4] Tests --- .github/workflows/run-tests.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 58371ea..a3d55b4 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -14,9 +14,11 @@ jobs: fail-fast: true matrix: php: [8.3, 8.2, 8.1, 8.0] - laravel: [10.*, 9.*] + laravel: [11.*, 10.*, 9.*] dependency-version: [prefer-lowest, prefer-stable] include: + - laravel: 11.* + testbench: ^8.0 - laravel: 10.* testbench: ^8.0 - laravel: 9.* @@ -26,6 +28,9 @@ jobs: php: 8.3 - laravel: 10.* php: 8.0 + - laravel: 11.* + php: 8.0 + php: 8.1 name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} From c52318eec34c6d6ba01217ebdf257308280da9d7 Mon Sep 17 00:00:00 2001 From: mchev Date: Tue, 12 Mar 2024 14:06:08 +0100 Subject: [PATCH 2/4] Update readme and fix workflow --- .github/workflows/run-tests.yml | 5 ++--- README.md | 1 + src/BanhammerServiceProvider.php | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index a3d55b4..c39b44f 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -29,10 +29,9 @@ jobs: - laravel: 10.* php: 8.0 - laravel: 11.* - php: 8.0 - php: 8.1 + php: [8.0, 8.1] - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} steps: - name: Checkout code diff --git a/README.md b/README.md index 07286ee..809f660 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ Banned models can have an expiration date and will be automatically unbanned usi :---------------------|:---------- ^9.0 | 1.x, 2.x ^10.0 | 1.x, 2.x + ^11.0 | 1.x, 2.x ## Installation diff --git a/src/BanhammerServiceProvider.php b/src/BanhammerServiceProvider.php index f0bfa19..6bda4c1 100644 --- a/src/BanhammerServiceProvider.php +++ b/src/BanhammerServiceProvider.php @@ -40,6 +40,11 @@ public function boot(): void __DIR__.'/../config/config.php' => config_path('ban.php'), ], 'banhammer-config'); + // Publishing migrations + // $this->publishes([ + // __DIR__.'/../database/migrations' => database_path('migrations'), + // ], 'banhammer-migrations'); + // Registering package commands. $this->commands([ ClearBans::class, From d816edeb1458e867850516235c014fcc0fb6bc06 Mon Sep 17 00:00:00 2001 From: mchev Date: Tue, 12 Mar 2024 16:06:49 +0100 Subject: [PATCH 3/4] Exclude php 8.0 and 8.1 for laravel 11 tests --- .github/workflows/run-tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index c39b44f..6606896 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -18,7 +18,7 @@ jobs: dependency-version: [prefer-lowest, prefer-stable] include: - laravel: 11.* - testbench: ^8.0 + testbench: ^9.0 - laravel: 10.* testbench: ^8.0 - laravel: 9.* @@ -29,7 +29,9 @@ jobs: - laravel: 10.* php: 8.0 - laravel: 11.* - php: [8.0, 8.1] + php: 8.0 + - laravel: 11.* + php: 8.1 name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} From 2439301dc7eac49752585b53168d960d1af81595 Mon Sep 17 00:00:00 2001 From: mchev Date: Tue, 12 Mar 2024 16:20:00 +0100 Subject: [PATCH 4/4] Update phpunit configuration --- .phpunit.cache/test-results | 1 + composer.json | 4 +-- phpunit.xml.dist | 69 +++++++++++++------------------------ phpunit.xml.dist.bak | 48 ++++++++++++++++++++++++++ 4 files changed, 74 insertions(+), 48 deletions(-) create mode 100644 .phpunit.cache/test-results create mode 100644 phpunit.xml.dist.bak diff --git a/.phpunit.cache/test-results b/.phpunit.cache/test-results new file mode 100644 index 0000000..72ac2cc --- /dev/null +++ b/.phpunit.cache/test-results @@ -0,0 +1 @@ +{"version":1,"defects":[],"times":{"Mchev\\Banhammer\\Tests\\Unit\\IPBannedMiddlewareTest::it_blocks_the_banned_ip":0.002,"Mchev\\Banhammer\\Tests\\Unit\\IPBanTest::test_ip_ban_with_metas":0.003,"Mchev\\Banhammer\\Tests\\Unit\\IPBanTest::test_ip_is_unbanned":0.003,"Mchev\\Banhammer\\Tests\\Unit\\IPBanTest::test_ip_is_banned":0.003,"Mchev\\Banhammer\\Tests\\Unit\\IPBanTest::test_multiple_ip_are_banned":0.002,"Mchev\\Banhammer\\Tests\\Unit\\IPBanTest::test_ip_ban_can_be_created":0.05,"Mchev\\Banhammer\\Tests\\Unit\\BlockByCountryMiddlewareTest::it_allows_request_from_non_blocked_country":0.001,"Mchev\\Banhammer\\Tests\\Unit\\BlockByCountryMiddlewareTest::it_blocks_request_from_blocked_country":0.001,"Mchev\\Banhammer\\Tests\\Unit\\BlockByCountryMiddlewareTest::it_allows_request_when_cache_is_present":0.007,"Mchev\\Banhammer\\Tests\\Unit\\BlockByCountryMiddlewareTest::it_allows_request_when_country_check_fails":0.023}} \ No newline at end of file diff --git a/composer.json b/composer.json index d0f43bb..c5b3fd2 100644 --- a/composer.json +++ b/composer.json @@ -23,8 +23,8 @@ "php": "^8.0" }, "require-dev": { - "orchestra/testbench": "^7.0|^8.0", - "phpunit/phpunit": "^9.5" + "orchestra/testbench": "^7.0|^8.0|^9.0", + "phpunit/phpunit": "^9.5|^10.5|^11.0" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index c7b5079..0bc1b47 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,48 +1,25 @@ - - - - tests - - - - - ./src - - - - - - - - - - - - - - - - - - - + + + + tests + + + + + + + + + + + + + + + + + ./src + + diff --git a/phpunit.xml.dist.bak b/phpunit.xml.dist.bak new file mode 100644 index 0000000..c7b5079 --- /dev/null +++ b/phpunit.xml.dist.bak @@ -0,0 +1,48 @@ + + + + + tests + + + + + ./src + + + + + + + + + + + + + + + + + + + +