12-05-2026 Frontend dev
This commit is contained in:
parent
405df0a122
commit
5b8bdf4182
779 changed files with 480564 additions and 6241 deletions
29
tests/Feature/Admin/AdminPerformanceCacheTest.php
Normal file
29
tests/Feature/Admin/AdminPerformanceCacheTest.php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
use App\Models\Company;
|
||||
use App\Services\Admin\AdminPerformanceCache;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Spatie\Permission\Models\Role;
|
||||
|
||||
test('admin performance cache is flushed when observed models change', function () {
|
||||
Cache::put(AdminPerformanceCache::DashboardStats, ['stale' => true], 600);
|
||||
Cache::put(AdminPerformanceCache::PressReleaseStats, ['stale' => true], 600);
|
||||
Cache::put(AdminPerformanceCache::RoleOptions, ['stale' => true], 600);
|
||||
|
||||
Company::factory()->create();
|
||||
|
||||
expect(Cache::has(AdminPerformanceCache::DashboardStats))->toBeFalse()
|
||||
->and(Cache::has(AdminPerformanceCache::PressReleaseStats))->toBeFalse()
|
||||
->and(Cache::has(AdminPerformanceCache::RoleOptions))->toBeFalse();
|
||||
});
|
||||
|
||||
test('admin role option cache is flushed when roles change', function () {
|
||||
Cache::put(AdminPerformanceCache::RoleOptions, ['stale' => true], 600);
|
||||
|
||||
Role::query()->create([
|
||||
'name' => 'temporary-admin-role',
|
||||
'guard_name' => 'web',
|
||||
]);
|
||||
|
||||
expect(Cache::has(AdminPerformanceCache::RoleOptions))->toBeFalse();
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue