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));