Skip to content

Commit 781f95b

Browse files
Laravel 13.x Compatibility (#75)
* Bump dependencies for Laravel 13 * Update GitHub Actions for Laravel 13 * Normalize content-type --------- Co-authored-by: Shift <shift@laravelshift.com>
1 parent 5415c0b commit 781f95b

3 files changed

Lines changed: 19 additions & 9 deletions

File tree

.github/workflows/test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,18 @@ jobs:
1111
strategy:
1212
matrix:
1313
php: [8.4, 8.3, 8.2, 8.1]
14-
laravel: ['10.*', '11.*', '12.*']
14+
laravel: ['10.*', '11.*', '12.*', '13.*']
1515
exclude:
1616
- php: 8.1
1717
laravel: 11.*
1818
- php: 8.4
1919
laravel: 10.*
2020
- laravel: 12.*
2121
php: 8.1
22+
- laravel: 13.*
23+
php: 8.2
24+
- laravel: 13.*
25+
php: 8.1
2226

2327
name: P${{ matrix.php }} - L${{ matrix.laravel }}
2428

composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@
1818
"homepage": "https://github.com/olssonm/l5-very-basic-auth",
1919
"require": {
2020
"php": "^8.0 || ^8.1 || ^8.2",
21-
"illuminate/support": "^9.0 || ^10.0 || ^11.0 || ^12.0"
21+
"illuminate/support": "^9.0 || ^10.0 || ^11.0 || ^12.0 || ^13.0"
2222
},
2323
"require-dev": {
2424
"laravel/helpers": "^1.1",
25-
"orchestra/testbench": "^7.0 || ^8.0 || ^9.0 || ^10.0",
26-
"pestphp/pest": "^1.0 || ^2.0 || ^3.7",
27-
"pestphp/pest-plugin-laravel": "^1.2 || ^2.0 || ^3.1",
25+
"orchestra/testbench": "^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0",
26+
"pestphp/pest": "^1.0 || ^2.0 || ^3.7 || ^4.4",
27+
"pestphp/pest-plugin-laravel": "^1.2 || ^2.0 || ^3.1 || ^4.1",
2828
"phpstan/phpstan": "^2.0",
29-
"phpunit/phpunit": "^9.0 || ^10.5 || ^11.5.3",
30-
"squizlabs/php_codesniffer": "^3.5"
29+
"phpunit/phpunit": "^9.0 || ^10.5 || ^11.5.3 || ^12.5.12",
30+
"squizlabs/php_codesniffer": "^3.5 || ^4.0"
3131
},
3232
"minimum-stability": "dev",
3333
"prefer-stable": true,

tests/VeryBasicAuthTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22

3+
use Illuminate\Support\Str;
34
use Olssonm\VeryBasicAuth\Handlers\DefaultResponseHandler;
45
use Olssonm\VeryBasicAuth\Handlers\ResponseHandler;
56
use Olssonm\VeryBasicAuth\Http\Middleware\VeryBasicAuth;
@@ -50,7 +51,7 @@
5051
])->get('/');
5152

5253
expect($response->getStatusCode())->toEqual(401);
53-
expect($response->headers->get('content-type'))->toEqual('text/html; charset=UTF-8');
54+
expect(requestHeader($response))->toEqual('text/html; charset=utf-8');
5455
expect($response->headers->get('WWW-Authenticate'))->toEqual(sprintf('Basic realm="%s", charset="UTF-8"', config('very_basic_auth.realm')));
5556
expect($response->getContent())->toEqual(config('very_basic_auth.error_message'));
5657
});
@@ -93,7 +94,7 @@
9394
])->get('/');
9495

9596
expect($response->getStatusCode())->toEqual(401);
96-
expect($response->headers->get('content-type'))->toEqual('text/html; charset=UTF-8');
97+
expect(requestHeader($response))->toEqual('text/html; charset=utf-8');
9798
expect($response->headers->get('WWW-Authenticate'))->toEqual(sprintf('Basic realm="%s", charset="UTF-8"', config('very_basic_auth.realm')));
9899

99100
$this->assertStringContainsStringIgnoringCase('This is the default view for the olssonm/l5-very-basic-auth-package', $response->getContent());
@@ -208,3 +209,8 @@
208209
expect(app()->make('hash')->check($password, $hashedPassword))->toBeTrue();
209210
expect(config('app.name'))->toEqual('Laravel');
210211
});
212+
213+
function requestHeader($response): string
214+
{
215+
return Str::lower($response->headers->get('content-type'));
216+
}

0 commit comments

Comments
 (0)