fedi-feed-router/database/factories/ArticleFactory.php
myrmidex ff855facda
Some checks failed
CI / ci (push) Successful in 5m14s
CI / ci (pull_request) Failing after 5m13s
Fix flaky test from duplicate Article factory URLs
2026-03-18 21:39:22 +01:00

32 lines
868 B
PHP

<?php
namespace Database\Factories;
use App\Models\Article;
use App\Models\Feed;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends Factory<Article>
*/
class ArticleFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'feed_id' => Feed::factory(),
'url' => $this->faker->unique()->url(),
'title' => $this->faker->sentence(),
'description' => $this->faker->paragraph(),
'content' => $this->faker->paragraphs(3, true),
'image_url' => $this->faker->optional()->imageUrl(),
'published_at' => $this->faker->optional()->dateTimeBetween('-1 month', 'now'),
'author' => $this->faker->optional()->name(),
];
}
}