Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for laravel 11 #12

Merged
merged 4 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ^9.0
- laravel: 10.*
testbench: ^8.0
- laravel: 9.*
Expand All @@ -26,8 +28,12 @@ jobs:
php: 8.3
- laravel: 10.*
php: 8.0
- laravel: 11.*
php: 8.0
- laravel: 11.*
php: 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
Expand Down
1 change: 1 addition & 0 deletions .phpunit.cache/test-results
Original file line number Diff line number Diff line change
@@ -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}}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
69 changes: 23 additions & 46 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,48 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
executionOrder="random"
failOnWarning="true"
failOnRisky="true"
failOnEmptyTestSuite="true"
beStrictAboutOutputDuringTests="true"
verbose="true"
>
<testsuites>
<testsuite name="Mchev Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<coverage>
<include>
<directory suffix=".php">./src</directory>
</include>
<report>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
<clover outputFile="build/logs/clover.xml"/>
</report>
</coverage>
<logging>
<junit outputFile="build/report.junit.xml"/>
</logging>
<php>
<env name="APP_ENV" value="testing"/>
<env name="DB_CONNECTION" value="sqlite"/>
<env name="DB_DATABASE" value=":memory:"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_DRIVER" value="sync"/>
<env name="MAIL_DRIVER" value="array"/>
</php>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" executionOrder="random" failOnWarning="true" failOnRisky="true" failOnEmptyTestSuite="true" beStrictAboutOutputDuringTests="true" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<testsuites>
<testsuite name="Mchev Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<logging>
<junit outputFile="build/report.junit.xml"/>
</logging>
<php>
<env name="APP_ENV" value="testing"/>
<env name="DB_CONNECTION" value="sqlite"/>
<env name="DB_DATABASE" value=":memory:"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_DRIVER" value="sync"/>
<env name="MAIL_DRIVER" value="array"/>
</php>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
48 changes: 48 additions & 0 deletions phpunit.xml.dist.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
executionOrder="random"
failOnWarning="true"
failOnRisky="true"
failOnEmptyTestSuite="true"
beStrictAboutOutputDuringTests="true"
verbose="true"
>
<testsuites>
<testsuite name="Mchev Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<coverage>
<include>
<directory suffix=".php">./src</directory>
</include>
<report>
<html outputDirectory="build/coverage"/>
<text outputFile="build/coverage.txt"/>
<clover outputFile="build/logs/clover.xml"/>
</report>
</coverage>
<logging>
<junit outputFile="build/report.junit.xml"/>
</logging>
<php>
<env name="APP_ENV" value="testing"/>
<env name="DB_CONNECTION" value="sqlite"/>
<env name="DB_DATABASE" value=":memory:"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_DRIVER" value="sync"/>
<env name="MAIL_DRIVER" value="array"/>
</php>
</phpunit>
5 changes: 5 additions & 0 deletions src/BanhammerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading