- Create Database/Factories for ContentWebhookEndpoint, ContentWebhookLog, ContentItem, ContentTaxonomy, ContentBrief - Register HTML5 elements (section, article, figure, figcaption, mark) with HTMLPurifier custom definitions - Use RefreshDatabase trait in TestCase with SQLite in-memory DB - Update Pest.php to use custom Tests\TestCase Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
29 lines
820 B
PHP
29 lines
820 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Core\Mod\Content\Database\Factories;
|
|
|
|
use Core\Mod\Content\Enums\ContentType;
|
|
use Core\Mod\Content\Models\ContentItem;
|
|
use Core\Tenant\Models\Workspace;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
class ContentItemFactory extends Factory
|
|
{
|
|
protected $model = ContentItem::class;
|
|
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'workspace_id' => Workspace::factory(),
|
|
'content_type' => ContentType::NATIVE->value,
|
|
'type' => 'post',
|
|
'status' => 'publish',
|
|
'slug' => $this->faker->slug(),
|
|
'title' => $this->faker->sentence(),
|
|
'excerpt' => $this->faker->paragraph(),
|
|
'content_html' => '<p>' . $this->faker->paragraphs(3, true) . '</p>',
|
|
];
|
|
}
|
|
}
|