mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
Fix FilamentTimezone not working as expected (#19568)
* Fix FilamentTimezone not working as expected * Update and rename tests/src/Support/FilamentTimezoneTest.php to tests/src/Support/Facades/FilamentTimezoneTest.php Signed-off-by: Dan Harrin <git@danharrin.com> --------- Signed-off-by: Dan Harrin <git@danharrin.com> Co-authored-by: Dan Harrin <git@danharrin.com>
This commit is contained in:
co-authored by
Dan Harrin
parent
389716a28f
commit
3685caa7a0
@@ -76,6 +76,11 @@ class SupportServiceProvider extends PackageServiceProvider
|
||||
fn () => new CliManager,
|
||||
);
|
||||
|
||||
$this->app->singleton(
|
||||
TimezoneManager::class,
|
||||
fn () => new TimezoneManager,
|
||||
);
|
||||
|
||||
$this->app->scoped(
|
||||
ScopedComponentManager::class,
|
||||
fn () => $this->app->make(ComponentManager::class)->clone(),
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
use Filament\Support\Facades\FilamentTimezone;
|
||||
use Filament\Tests\TestCase;
|
||||
|
||||
uses(TestCase::class);
|
||||
|
||||
it('can be set to a specific timezone', function (): void {
|
||||
FilamentTimezone::set('America/Vancouver');
|
||||
|
||||
expect(FilamentTimezone::get())->toBe('America/Vancouver');
|
||||
});
|
||||
Reference in New Issue
Block a user