Files
fotospiel-app/tests/Unit/Models/AiStyleVersioningTest.php
Codex Agent 1d2242fb4d
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled
feat(ai): finalize AI magic edits epic rollout and operations
2026-02-06 22:41:51 +01:00

47 lines
1.2 KiB
PHP

<?php
namespace Tests\Unit\Models;
use App\Models\AiStyle;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AiStyleVersioningTest extends TestCase
{
use RefreshDatabase;
public function test_style_defaults_to_version_one_on_create(): void
{
$style = AiStyle::query()->create([
'key' => 'style-version-default',
'name' => 'Version Default',
'provider' => 'runware',
'provider_model' => 'runware-default',
'is_active' => true,
]);
$this->assertSame(1, $style->version);
}
public function test_style_version_increments_when_core_style_fields_change(): void
{
$style = AiStyle::query()->create([
'key' => 'style-version-increment',
'name' => 'Version Increment',
'provider' => 'runware',
'provider_model' => 'runware-default',
'prompt_template' => 'Initial prompt',
'is_active' => true,
]);
$this->assertSame(1, $style->version);
$style->update([
'prompt_template' => 'Updated prompt',
]);
$style->refresh();
$this->assertSame(2, $style->version);
}
}