Skip to content

Commit

Permalink
test: prevent flaky test by freezing time
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphjsmit committed Jun 15, 2024
1 parent fdd7713 commit 5d709b2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace RalphJSmit\Laravel\SEO\Tests;

use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Schema;
use Orchestra\Testbench\TestCase as Orchestra;
use RalphJSmit\Laravel\SEO\LaravelSEOServiceProvider;
Expand All @@ -16,6 +17,9 @@ protected function setUp(): void
Factory::guessFactoryNamesUsing(
fn (string $modelName) => 'RalphJSmit\\Laravel\\SEO\\Database\\Factories\\' . class_basename($modelName) . 'Factory'
);

// Freeze the time across entire testsuite...
Carbon::setTestNow(now());
}

protected function getPackageProviders($app)
Expand Down

0 comments on commit 5d709b2

Please sign in to comment.