From 639ca1aa28f56db5583772cc49531b1fef2f6018 Mon Sep 17 00:00:00 2001 From: Italo Israel Baeza Cabrera Date: Wed, 22 Feb 2023 01:56:23 -0300 Subject: [PATCH] Fixes test for migration publishing. --- tests/ServiceProviderTest.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/ServiceProviderTest.php b/tests/ServiceProviderTest.php index 758878d..17bc01a 100644 --- a/tests/ServiceProviderTest.php +++ b/tests/ServiceProviderTest.php @@ -3,6 +3,7 @@ namespace Tests; use Illuminate\Contracts\Auth\Authenticatable; +use Illuminate\Support\Carbon; use Illuminate\Support\Facades\File; use Illuminate\Support\Fluent; use Illuminate\Support\ServiceProvider; @@ -28,19 +29,25 @@ class ServiceProviderTest extends TestCase ); } + /** + * @define-env usesCustomTestTime + */ public function test_publishes_migrations(): void { - $format = now()->format('Y_m_d_His'); - static::assertSame( [ realpath(WebAuthnServiceProvider::MIGRATIONS . '/2022_07_01_000000_create_webauthn_credentials.php') => - $this->app->databasePath("migrations/{$format}_create_webauthn_credentials.php"), + $this->app->databasePath("migrations/2020_01_01_163025_create_webauthn_credentials.php"), ], ServiceProvider::pathsToPublish(WebAuthnServiceProvider::class, 'migrations') ); } + protected function usesCustomTestTime() + { + $this->travelTo(Carbon::create(2020, 01, 01, 16, 30, 25)); + } + public function test_bounds_user(): void { static::assertNull($this->app->make(WebAuthnAuthenticatable::class));