Skip to content

Commit

Permalink
maybe fixed tests4
Browse files Browse the repository at this point in the history
  • Loading branch information
pushrbx committed Jun 20, 2024
1 parent 7190979 commit aa8d8a6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion database/factories/JikanMediaModelFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ protected function getOverridesFromQueryStringParameters(Collection $additionalP
$endDate = $this->adaptDateString($additionalParams["end_date"]);
$to = Carbon::parse($endDate);
$from = $to->copy()->subDays($this->faker->randomElement([30, 60, 90, 120, 180]));
$overrides[$activityMarkerKeyName] = new CarbonDateRange($from, $to->subDays($this->faker->numberBetween(0, 25)));
$overrides[$activityMarkerKeyName] = new CarbonDateRange($from, $to->subDays($this->faker->numberBetween(1, 25)));
}

if ($additionalParams->has(["start_date", "end_date"])
Expand Down
6 changes: 6 additions & 0 deletions database/factories/JikanModelFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@
use JMS\Serializer\Serializer;
use \Illuminate\Database\Eloquent\Factories\Factory;
use Spatie\Enum\Laravel\Faker\FakerEnumProvider;
use Illuminate\Support\Str;

abstract class JikanModelFactory extends Factory
{
public function configure(): JikanModelFactory|static
{
$this->faker->addProvider(new FakerEnumProvider($this->faker));
if (array_key_exists("GITHUB_JOB", $_ENV) && $_ENV["GITHUB_JOB"] !== "") {
$this->faker->seed($_ENV["GITHUB_JOB"]);
} else {
$this->faker->seed(Str::random());
}
return $this;
}

Expand Down

0 comments on commit aa8d8a6

Please sign in to comment.