add all controllers logic

This commit is contained in:
root
2026-03-11 17:53:15 -04:00
parent 3e6c577085
commit 2ef71cc92b
421 changed files with 12009 additions and 5211 deletions
@@ -0,0 +1,32 @@
<?php
namespace Tests\Unit\Services\Frontend;
use App\Services\Frontend\StaticPageService;
use Illuminate\Support\Facades\File;
use Tests\TestCase;
class StaticPageServiceTest extends TestCase
{
public function test_load_returns_content(): void
{
$dir = public_path('html');
File::ensureDirectoryExists($dir);
File::put($dir . '/terms_of_service.html', '<h1>Terms</h1>');
$service = new StaticPageService();
$result = $service->load('terms_of_service.html', 'terms_of_service');
$this->assertTrue($result['ok']);
$this->assertSame('terms_of_service', $result['type']);
$this->assertStringContainsString('Terms', $result['content']);
}
public function test_load_missing_returns_error(): void
{
$service = new StaticPageService();
$result = $service->load('missing.html', 'missing');
$this->assertFalse($result['ok']);
}
}