Files
fotospiel-app/tests/Feature/Help/HelpSyncServiceTest.php
Codex Agent 0db0ddf3c4
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled
Add related help titles and fix umlauts
2026-01-23 10:05:29 +01:00

35 lines
1.2 KiB
PHP

<?php
namespace Tests\Feature\Help;
use App\Services\Help\HelpSyncService;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\Storage;
use Tests\TestCase;
class HelpSyncServiceTest extends TestCase
{
public function test_help_sync_writes_compiled_articles(): void
{
Storage::fake('local');
Config::set('help.disk', 'local');
$service = $this->app->make(HelpSyncService::class);
$result = $service->sync();
$this->assertNotEmpty($result);
Storage::disk('local')->assertExists('help/guest/en/articles.json');
Storage::disk('local')->assertExists('help/guest/de/articles.json');
Storage::disk('local')->assertExists('help/admin/en/articles.json');
$articles = json_decode(Storage::disk('local')->get('help/admin/en/articles.json'), true);
$this->assertIsArray($articles);
$controlRoom = collect($articles)->firstWhere('slug', 'control-room-moderation');
$this->assertNotNull($controlRoom);
$related = collect($controlRoom['related'] ?? [])->firstWhere('slug', 'event-prep-checklist');
$this->assertSame('Event Preparation Checklist', $related['title'] ?? null);
}
}