fix: add factories, fix HtmlSanitiser HTML5 elements, fix TestCase
- 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>
2026-02-23 07:01:48 +00:00
|
|
|
<?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(),
|
2026-02-23 11:49:27 +00:00
|
|
|
'content_html' => '<p>'.$this->faker->paragraphs(3, true).'</p>',
|
fix: add factories, fix HtmlSanitiser HTML5 elements, fix TestCase
- 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>
2026-02-23 07:01:48 +00:00
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|