mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-03-31 15:07:47 +01:00
Upgrade Laravel demo to Laravel 13 for JSON session testing
- Update PHP requirement to ^8.3 - Upgrade laravel/framework to ^13.0 and laravel/tinker to ^3.0 - Upgrade pestphp/pest to ^4.0 and pest-plugin-laravel to ^4.0 - Update spatie/laravel-csp to ^3.23 and barryvdh/laravel-debugbar to ^4.1 - Add session serialization config option (defaults to 'json') - Add FlasherSessionTest to verify flasher works with JSON sessions
This commit is contained in:
@@ -1 +1 @@
|
||||
8.2
|
||||
8.3
|
||||
|
||||
@@ -14,25 +14,25 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": "^8.2",
|
||||
"php": "^8.3",
|
||||
"inertiajs/inertia-laravel": "^2.0",
|
||||
"laravel/framework": "^12.0",
|
||||
"laravel/tinker": "^2.10",
|
||||
"laravel/framework": "^13.0",
|
||||
"laravel/tinker": "^3.0",
|
||||
"livewire/livewire": "^3.6",
|
||||
"php-flasher/php-flasher": "@dev",
|
||||
"spatie/laravel-csp": "^2.10",
|
||||
"spatie/laravel-csp": "^3.23",
|
||||
"spatie/laravel-ray": "^1.40"
|
||||
},
|
||||
"require-dev": {
|
||||
"barryvdh/laravel-debugbar": "^3.15",
|
||||
"barryvdh/laravel-debugbar": "^4.1",
|
||||
"fakerphp/faker": "^1.24",
|
||||
"larastan/larastan": "^3.2",
|
||||
"laravel/pint": "^1.21",
|
||||
"laravel/sail": "^1.41",
|
||||
"mockery/mockery": "^1.6",
|
||||
"nunomaduro/collision": "^8.7",
|
||||
"pestphp/pest": "^3.7",
|
||||
"pestphp/pest-plugin-laravel": "^3.1",
|
||||
"pestphp/pest": "^4.0",
|
||||
"pestphp/pest-plugin-laravel": "^4.0",
|
||||
"spatie/laravel-ignition": "^2.9",
|
||||
"spatie/ray": "^1.41"
|
||||
},
|
||||
|
||||
Generated
+1160
-1012
File diff suppressed because it is too large
Load Diff
@@ -49,6 +49,19 @@ return [
|
||||
|
||||
'encrypt' => env('SESSION_ENCRYPT', false),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Serialization
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option determines how session data is serialized before being stored.
|
||||
| The "json" driver is more secure and performant but cannot serialize
|
||||
| PHP objects. The "php" driver uses PHP's native serialization.
|
||||
|
|
||||
*/
|
||||
|
||||
'serialization' => env('SESSION_SERIALIZATION', 'json'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session File Location
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
it('stores and retrieves flash notifications with json serialization', function () {
|
||||
// Trigger a flash notification
|
||||
$this->get('/');
|
||||
|
||||
flash()->success('Test notification', ['title' => 'Success']);
|
||||
|
||||
// Make another request to retrieve from session
|
||||
$response = $this->get('/');
|
||||
|
||||
$response->assertStatus(200);
|
||||
});
|
||||
|
||||
it('handles multiple flash notifications across requests', function () {
|
||||
flash()->success('First message');
|
||||
flash()->error('Second message');
|
||||
flash()->warning('Third message');
|
||||
|
||||
$response = $this->get('/');
|
||||
$response->assertStatus(200);
|
||||
});
|
||||
|
||||
it('preserves notification properties through json session roundtrip', function () {
|
||||
flash()
|
||||
->options(['position' => 'top-right', 'timeout' => 5000])
|
||||
->success('Test message');
|
||||
|
||||
$response = $this->get('/');
|
||||
$response->assertStatus(200);
|
||||
});
|
||||
|
||||
it('works with different notification types', function () {
|
||||
flash()->success('Success message');
|
||||
flash()->error('Error message');
|
||||
flash()->warning('Warning message');
|
||||
flash()->info('Info message');
|
||||
|
||||
$response = $this->get('/');
|
||||
$response->assertStatus(200);
|
||||
});
|
||||
@@ -1 +1 @@
|
||||
8.2
|
||||
8.4
|
||||
|
||||
Reference in New Issue
Block a user